commit
47a6c9f963
1 changed files with 18 additions and 14 deletions
|
|
@ -293,11 +293,13 @@ export default {
|
|||
case "insertText":
|
||||
case "insertFromPaste":
|
||||
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();
|
||||
break;
|
||||
default:
|
||||
// If the user enters text by *autofill* then disable the *autocomplete*
|
||||
this.showAddressFields = true;
|
||||
//this.addressField1.dispatchEvent(new Event("change"))
|
||||
this.unloadAutocomplete();
|
||||
}
|
||||
});
|
||||
|
|
@ -444,22 +446,24 @@ export default {
|
|||
this.loadGooglePlacesAutocompleteScript();
|
||||
}
|
||||
|
||||
const element = document.getElementsByClassName("address-questions")[0];
|
||||
element.addEventListener("change", (e) => {
|
||||
if (this.showAddressFields) {
|
||||
return false;
|
||||
}
|
||||
// Temporary
|
||||
// const element = document.getElementsByClassName("address-questions")[0];
|
||||
// element.addEventListener("change", (e) => {
|
||||
// console.log(e)
|
||||
// if (this.showAddressFields) {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
let autoFilledInputs = [];
|
||||
autoFilledInputs = element.querySelectorAll("input:-webkit-autofill");
|
||||
// let autoFilledInputs = [];
|
||||
// autoFilledInputs = element.querySelectorAll("input:-webkit-autofill");
|
||||
|
||||
this.showAddressFields = autoFilledInputs.length > 0;
|
||||
if (this.showAddressFields) {
|
||||
this.unloadAutocomplete();
|
||||
}
|
||||
// this.showAddressFields = autoFilledInputs.length > 0;
|
||||
// if (this.showAddressFields) {
|
||||
// this.unloadAutocomplete();
|
||||
// }
|
||||
|
||||
this.addressField1.classList.remove("has-icon");
|
||||
});
|
||||
// this.addressField1.classList.remove("has-icon");
|
||||
// });
|
||||
},
|
||||
beforeUpdate() {
|
||||
// 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