Fix autocomplete issues caused by stopping 'change' propagation

Only stop propagation when the window is inactive, and don't fire the
synthetic event on blur. Does the same thing as efd7ec6 was intended to
do, but in a less heavy-handed way.

Fixes #3734
This commit is contained in:
Abe Jellinek 2024-02-22 16:39:20 -05:00
parent efd7ec6dc2
commit 93536a1592

View file

@ -191,7 +191,9 @@
this.setAttribute('value', this._input.value);
};
let handleChange = (event) => {
event.stopPropagation();
if (Services.focus.activeWindow !== window) {
event.stopPropagation();
}
this.setAttribute('value', this._input.value);
};
input.addEventListener('mousedown', () => {
@ -224,9 +226,6 @@
this._ignoredWindowInactiveBlur = false;
this.dispatchEvent(new Event('blur'));
if (this.value !== this._input.dataset.initialValue) {
this.dispatchEvent(new Event('change'));
}
this.classList.remove("focused");
this._input.scrollLeft = 0;
this._input.setSelectionRange(0, 0);