diff --git a/src/App.vue b/src/App.vue index d817ff749..9ee03e8dd 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,17 +5,17 @@ name="route-fade" mode="out-in"> - + diff --git a/src/common-components/base-input-button/base-input-button.vue b/src/common-components/base-input-button/base-input-button.vue index 162f0866f..48033fd17 100644 --- a/src/common-components/base-input-button/base-input-button.vue +++ b/src/common-components/base-input-button/base-input-button.vue @@ -26,7 +26,7 @@ import { useField } from "vee-validate"; import { toRef } from "vue"; import { queryStrings } from "@/constants/query-strings"; -import { handleInputFocus, handleInputBlur } from "@/helpers/input-button-focus-helper"; +import { handleButtonComponentFocus, handleInputComponentBlur } from "@/helpers/button-question-focus-helper"; import { inputButtonProps } from "@/common-components/base-input-button/button-functionality-props"; export default { @@ -104,14 +104,14 @@ export default { this.$emit("update:modelValue", this.valueToEmit); }, handleFocus() { - handleInputFocus({ + handleButtonComponentFocus({ groupName: this.groupName, }); }, handleBlur() { - handleInputBlur({ + handleInputComponentBlur({ groupName: this.groupName, - onFocusCallback: this.handlePushClickEventToGACheck, + onButtonQuestionLostFocusCallback: this.handlePushClickEventToGACheck, }); }, handlePushClickEventToGACheck(source) { diff --git a/src/helpers/analytics-helper.js b/src/helpers/analytics-helper.js deleted file mode 100644 index 23b6557ed..000000000 --- a/src/helpers/analytics-helper.js +++ /dev/null @@ -1,35 +0,0 @@ -let lastFocusedInputGroupName = ""; -let onFocusCallback = null; - -// TODO KO Add tests for this file -const handleChildFocus = (e) => { - const targetType = e.target.type; - if (targetType !== "radio" && targetType !== "checkbox") { - handleInputFocus({ - groupName: null, - }); - } -} - -const handleInputFocus = (e) => { - if ( - e && - lastFocusedInputGroupName !== e.groupName && - onFocusCallback - ) { - onFocusCallback(); - } -} - -const handleInputBlur = (e) => { - if (e) { - lastFocusedInputGroupName = e.groupName; - onFocusCallback = e.onFocusCallback; - } -} - -export { - handleChildFocus, - handleInputFocus, - handleInputBlur -} \ No newline at end of file