From 9325f773cc6a97e2a620e9a7b67f99e858526a96 Mon Sep 17 00:00:00 2001 From: abaevbog Date: Thu, 23 May 2024 00:16:36 -0400 Subject: [PATCH] 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 101e6d55d507723c4d59e79dc304bdba03721953 Fixes: #3575 --- chrome/content/zotero/elements/editableText.js | 2 +- test/tests/tagsboxTest.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/elements/editableText.js b/chrome/content/zotero/elements/editableText.js index 1fa6ec689f..19cb20cf54 100644 --- a/chrome/content/zotero/elements/editableText.js +++ b/chrome/content/zotero/elements/editableText.js @@ -324,8 +324,8 @@ this._ignoredWindowInactiveBlur = true; return; } - this._resetStateAfterBlur(); this.dispatchEvent(new Event('blur')); + this._resetStateAfterBlur(); }; _resetStateAfterBlur() { diff --git a/test/tests/tagsboxTest.js b/test/tests/tagsboxTest.js index 0743a04fa2..4891a1ceba 100644 --- a/test/tests/tagsboxTest.js +++ b/test/tests/tagsboxTest.js @@ -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.