Testing again

This commit is contained in:
Leah Schumann 2024-05-22 10:57:18 -04:00
parent 4ef2efd9e6
commit cbc956b017

View file

@ -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.