Merge pull request #1865 from Safelite/feature/CSR-2065
Setting this.matchedFound to true when autofilling
This commit is contained in:
commit
4fcf891acb
1 changed files with 25 additions and 18 deletions
|
|
@ -293,23 +293,18 @@ export default {
|
|||
this.addressField1.addEventListener("input", (e) => {
|
||||
// console.log(`input event`);
|
||||
// console.log(e);
|
||||
|
||||
this.$nextTick(() => {
|
||||
switch (e.inputType) {
|
||||
case "insertText":
|
||||
case "insertFromPaste":
|
||||
case "deleteContentBackward":
|
||||
// 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.classList.remove("has-icon");
|
||||
//this.addressField1.dispatchEvent(new Event("change"))
|
||||
this.unloadAutocomplete();
|
||||
}
|
||||
});
|
||||
console.log("input");
|
||||
switch (e.inputType) {
|
||||
case "insertText":
|
||||
case "insertFromPaste":
|
||||
case "deleteContentBackward":
|
||||
// If the user enters text by typing, or pasting text, or deleting text already entered, disable *autofill*
|
||||
this.disableAutoFill();
|
||||
break;
|
||||
default:
|
||||
this.matchFound = true;
|
||||
this.addressField1.classList.remove("has-icon");
|
||||
}
|
||||
});
|
||||
},
|
||||
disableAutoFill() {
|
||||
|
|
@ -443,7 +438,7 @@ export default {
|
|||
},
|
||||
},
|
||||
mounted() {
|
||||
// If we already have a full address, show it
|
||||
//If we already have a full address, show it
|
||||
this.showAddressFields =
|
||||
(this.addressModel.streetAddress ?? "") !== "" &&
|
||||
(this.addressModel.city ?? "") !== "" &&
|
||||
|
|
@ -527,10 +522,22 @@ export default {
|
|||
},
|
||||
{ deep: true, flush: "post" }
|
||||
);
|
||||
} else {
|
||||
this.showAddressFields = true;
|
||||
this.addressField1.classList.remove("has-icon");
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
// addressModel: {
|
||||
// handler(newValue) {
|
||||
// this.$nextTick(() => {
|
||||
// this.showAddressFields = true;
|
||||
// })
|
||||
|
||||
// },
|
||||
// deep: true
|
||||
// }
|
||||
},
|
||||
components: {
|
||||
textboxQuestion,
|
||||
|
|
|
|||
Loading…
Reference in a new issue