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

adding console logs to view on Chrome iOS
This commit is contained in:
Leah Schumann 2024-05-22 14:39:53 -04:00 committed by GitHub
commit 5e1213f38a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -287,6 +287,7 @@ export default {
// });
this.addressField1.addEventListener("input", (e) => {
console.log(`input event`);
console.log(e);
switch (e.inputType) {
@ -298,7 +299,7 @@ export default {
break;
default:
// If the user enters text by *autofill* then disable the *autocomplete*
this.showAddressFields = true;
//this.showAddressFields = true;
//this.addressField1.dispatchEvent(new Event("change"))
this.unloadAutocomplete();
}
@ -447,23 +448,24 @@ export default {
}
// Temporary
// const element = document.getElementsByClassName("address-questions")[0];
// element.addEventListener("change", (e) => {
// console.log(e)
// if (this.showAddressFields) {
// return false;
// }
const element = document.getElementsByClassName("address-questions")[0];
element.addEventListener("change", (e) => {
console.log(`change event`);
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.