Merge pull request #1865 from Safelite/feature/CSR-2065

Setting this.matchedFound to true when autofilling
This commit is contained in:
Leah Schumann 2024-05-23 14:48:09 -04:00 committed by GitHub
commit 4fcf891acb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -293,8 +293,7 @@ export default {
this.addressField1.addEventListener("input", (e) => { this.addressField1.addEventListener("input", (e) => {
// console.log(`input event`); // console.log(`input event`);
// console.log(e); // console.log(e);
console.log("input");
this.$nextTick(() => {
switch (e.inputType) { switch (e.inputType) {
case "insertText": case "insertText":
case "insertFromPaste": case "insertFromPaste":
@ -303,14 +302,10 @@ export default {
this.disableAutoFill(); this.disableAutoFill();
break; break;
default: default:
// If the user enters text by *autofill* then disable the *autocomplete* this.matchFound = true;
this.showAddressFields = true;
this.addressField1.classList.remove("has-icon"); this.addressField1.classList.remove("has-icon");
//this.addressField1.dispatchEvent(new Event("change"))
this.unloadAutocomplete();
} }
}); });
});
}, },
disableAutoFill() { disableAutoFill() {
// For some reason we have to explicitly tell FireFox to set it to "off" which doesn't actually disable autofill // For some reason we have to explicitly tell FireFox to set it to "off" which doesn't actually disable autofill
@ -527,10 +522,22 @@ export default {
}, },
{ deep: true, flush: "post" } { deep: true, flush: "post" }
); );
} else {
this.showAddressFields = true;
this.addressField1.classList.remove("has-icon");
} }
}, },
deep: true, deep: true,
}, },
// addressModel: {
// handler(newValue) {
// this.$nextTick(() => {
// this.showAddressFields = true;
// })
// },
// deep: true
// }
}, },
components: { components: {
textboxQuestion, textboxQuestion,