Tags box: Fix tag being saved every time autocomplete popup hides

This commit is contained in:
Abe Jellinek 2024-01-17 03:21:01 -05:00 committed by Dan Stillman
parent f2bf40a314
commit b391b6ca21
2 changed files with 3 additions and 3 deletions

View file

@ -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 (_) {

View file

@ -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")];