From b391b6ca21849cd0b26e515bf8a2b8db835732a4 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Wed, 17 Jan 2024 03:21:01 -0500 Subject: [PATCH] Tags box: Fix tag being saved every time autocomplete popup hides --- chrome/content/zotero/tabs.js | 1 - chrome/content/zotero/zoteroPane.js | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/tabs.js b/chrome/content/zotero/tabs.js index e2a5a2aeae..0167f20fa0 100644 --- a/chrome/content/zotero/tabs.js +++ b/chrome/content/zotero/tabs.js @@ -988,7 +988,6 @@ var Zotero_Tabs = new function () { let menuFilter = document.getElementById('zotero-tabs-menu-filter'); menuFilter.value = ""; this._tabsMenuFilter = ""; - this.refreshTabsMenuList(); }; this.handleTabsMenuShown = function (_) { diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index f3266c95cc..8ba99fc7f3 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -446,8 +446,9 @@ var ZoteroPane = new function() // When a panel popup hides, refocus the previous element // When a menupopup hides, stop hiding the focus-ring - document.addEventListener("popuphiding", e => { - if (e.target.tagName == "panel") { + document.addEventListener("popuphiding", (e) => { + if (e.target.tagName == "panel" + && document.activeElement && e.target.contains(document.activeElement)) { ZoteroPane.lastFocusedElement.focus(); } let noFocus = [...document.querySelectorAll(".hidden-focus")];