CSR-762 Simplify multiselect
This commit is contained in:
parent
fff1aa1848
commit
e8b751c1b7
1 changed files with 21 additions and 14 deletions
|
|
@ -81,13 +81,13 @@ export default {
|
|||
if (this.isMultiSelect) {
|
||||
switch (eventType) {
|
||||
case eventTypes.KEYPRESS_SUBMIT:
|
||||
case eventTypes.CHANGE:
|
||||
this.handleClick(e);
|
||||
break;
|
||||
case eventTypes.CHANGE:
|
||||
this.selectOnKeypress
|
||||
? this.handleClick(e)
|
||||
: this.handleSelectionChange(e);
|
||||
break;
|
||||
// this.selectOnKeypress
|
||||
// ? this.handleClick(e)
|
||||
// : this.handleSelectionChange(e);
|
||||
// break;
|
||||
}
|
||||
} else {
|
||||
switch (eventType) {
|
||||
|
|
@ -143,8 +143,10 @@ export default {
|
|||
valueToLogType: this.valueToLogType,
|
||||
});
|
||||
|
||||
window.firedGaClickEventValues = window.firedGaClickEventValues ?? {}
|
||||
window.firedGaClickEventValues[window.lastFocusedInputGroup] = value ?? this.value
|
||||
window.firedGaClickEventValues =
|
||||
window.firedGaClickEventValues ?? {};
|
||||
window.firedGaClickEventValues[window.lastFocusedInputGroup] =
|
||||
value ?? this.value;
|
||||
this.pushEventToGA(
|
||||
this.$route.query[queryStrings.FMG_PAGE],
|
||||
this.GaActions.CLICKED,
|
||||
|
|
@ -155,29 +157,34 @@ export default {
|
|||
},
|
||||
handleBlur() {
|
||||
window.lastFocusedInputGroup = this.groupName;
|
||||
window.wasLastFocusedInputMultiselect = this.isMultiSelect
|
||||
window.wasLastFocusedInputMultiselect = this.isMultiSelect;
|
||||
},
|
||||
handleFocus() {
|
||||
console.log("FOCUS: ", {
|
||||
currentlySelectedValues: window.currentlySelectedValues,
|
||||
firedGaClickEventValues: window.firedGaClickEventValues,
|
||||
lastFocusedInputGroup: window.lastFocusedInputGroup,
|
||||
wasLastFocusedInputMultiselect: window.wasLastFocusedInputMultiselect,
|
||||
groupName: this.groupName
|
||||
})
|
||||
wasLastFocusedInputMultiselect:
|
||||
window.wasLastFocusedInputMultiselect,
|
||||
groupName: this.groupName,
|
||||
});
|
||||
if (
|
||||
window.currentlySelectedValues &&
|
||||
window.firedGaClickEventValues &&
|
||||
window.lastFocusedInputGroup &&
|
||||
!window.wasLastFocusedInputMultiselect &&
|
||||
!window.wasLastFocusedInputMultiselect &&
|
||||
window.currentlySelectedValues[window.lastFocusedInputGroup] &&
|
||||
window.lastFocusedInputGroup != this.groupName &&
|
||||
window.firedGaClickEventValues[window.lastFocusedInputGroup] != window.currentlySelectedValues[window.lastFocusedInputGroup]
|
||||
window.firedGaClickEventValues[window.lastFocusedInputGroup] !=
|
||||
window.currentlySelectedValues[window.lastFocusedInputGroup]
|
||||
) {
|
||||
// TODO MAKE SURE THIS IS FIRING THE RIGHT VALUE
|
||||
this.pushClickEventToGA(window.currentlySelectedValues[window.lastFocusedInputGroup])
|
||||
this.pushClickEventToGA(
|
||||
window.currentlySelectedValues[window.lastFocusedInputGroup]
|
||||
);
|
||||
}
|
||||
},
|
||||
test() {}
|
||||
},
|
||||
computed: {
|
||||
isChecked() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue