fix tagsbox enter glitch (#4160)

The 'blur' event needs to be dispatched by editable-text
before its state is reset (not after) because tagsbox uses
.initialValue in the 'blur' handler.

followup to 101e6d55d5

Fixes: #3575
This commit is contained in:
abaevbog 2024-05-23 00:16:36 -04:00 committed by GitHub
parent 721f54fe49
commit 9325f773cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -324,8 +324,8 @@
this._ignoredWindowInactiveBlur = true;
return;
}
this._resetStateAfterBlur();
this.dispatchEvent(new Event('blur'));
this._resetStateAfterBlur();
};
_resetStateAfterBlur() {

View file

@ -16,7 +16,7 @@ describe("Item Tags Box", function () {
describe("Tag Editing", function () {
it.skip("should update tag when pressing Enter in textbox", async function () {
it("should update tag when pressing Enter in textbox", async function () {
if (!doc.hasFocus()) {
// editable-text behavior relies on focus, so we first need to bring the window to the front.
// Not required on all platforms. In some cases (e.g. Linux), the window is at the front from the start.