Fix title/abstract saving when window becomes inactive

We weren't stopping 'change' from propagating upwards when the change hadn't
actually been committed yet, and the pane-header and abstract-box CEs
listen to that event instead of 'blur'.
This commit is contained in:
Abe Jellinek 2024-02-22 09:50:08 -05:00
parent 26fd57398c
commit efd7ec6dc2

View file

@ -190,7 +190,8 @@
}
this.setAttribute('value', this._input.value);
};
let handleChange = () => {
let handleChange = (event) => {
event.stopPropagation();
this.setAttribute('value', this._input.value);
};
input.addEventListener('mousedown', () => {
@ -222,7 +223,10 @@
}
this._ignoredWindowInactiveBlur = false;
this.dispatchEvent(new CustomEvent('blur'));
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);