commit
47a6c9f963
1 changed files with 18 additions and 14 deletions
|
|
@ -293,11 +293,13 @@ export default {
|
||||||
case "insertText":
|
case "insertText":
|
||||||
case "insertFromPaste":
|
case "insertFromPaste":
|
||||||
case "deleteContentBackward":
|
case "deleteContentBackward":
|
||||||
// If the user enters text by typing, or pasting text, or deleting text already entered, disable autofill
|
// If the user enters text by typing, or pasting text, or deleting text already entered, disable *autofill*
|
||||||
this.disableAutoFill();
|
this.disableAutoFill();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// If the user enters text by *autofill* then disable the *autocomplete*
|
// If the user enters text by *autofill* then disable the *autocomplete*
|
||||||
|
this.showAddressFields = true;
|
||||||
|
//this.addressField1.dispatchEvent(new Event("change"))
|
||||||
this.unloadAutocomplete();
|
this.unloadAutocomplete();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -444,22 +446,24 @@ export default {
|
||||||
this.loadGooglePlacesAutocompleteScript();
|
this.loadGooglePlacesAutocompleteScript();
|
||||||
}
|
}
|
||||||
|
|
||||||
const element = document.getElementsByClassName("address-questions")[0];
|
// Temporary
|
||||||
element.addEventListener("change", (e) => {
|
// const element = document.getElementsByClassName("address-questions")[0];
|
||||||
if (this.showAddressFields) {
|
// element.addEventListener("change", (e) => {
|
||||||
return false;
|
// console.log(e)
|
||||||
}
|
// if (this.showAddressFields) {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
|
||||||
let autoFilledInputs = [];
|
// let autoFilledInputs = [];
|
||||||
autoFilledInputs = element.querySelectorAll("input:-webkit-autofill");
|
// autoFilledInputs = element.querySelectorAll("input:-webkit-autofill");
|
||||||
|
|
||||||
this.showAddressFields = autoFilledInputs.length > 0;
|
// this.showAddressFields = autoFilledInputs.length > 0;
|
||||||
if (this.showAddressFields) {
|
// if (this.showAddressFields) {
|
||||||
this.unloadAutocomplete();
|
// this.unloadAutocomplete();
|
||||||
}
|
// }
|
||||||
|
|
||||||
this.addressField1.classList.remove("has-icon");
|
// this.addressField1.classList.remove("has-icon");
|
||||||
});
|
// });
|
||||||
},
|
},
|
||||||
beforeUpdate() {
|
beforeUpdate() {
|
||||||
// It is necessary to set focus on the street address on this lifecycle hook when this component is used in a modal.
|
// It is necessary to set focus on the street address on this lifecycle hook when this component is used in a modal.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue