Issue #2790 - Part 3: Address BZ bug 1849122 and resolve build issues

This commit is contained in:
MeladJM 2025-07-22 23:14:40 +08:00 committed by roytam1
commit 4cdfb9e16b
4 changed files with 33 additions and 4 deletions

View file

@ -31,6 +31,19 @@ function FormHandler(aForm, aWindow) {
this.window = aWindow;
this.fieldDetails = [];
// Add a reset event listener to clear autofill state
this.form.addEventListener("reset", () => {
console.log('Form reset detected, clearing autofill state');
for (let element of this.form.elements) {
if (typeof element.setAutofilled === "function") {
element.setAutofilled(false);
console.log('setAutofilled(false) called on', element);
}
}
// Optionally, clear fieldDetails if you want to force re-collection
// this.fieldDetails = [];
});
}
FormHandler.prototype = {