From 89320a7ee4d30b0ae35763e742d31e54cb6c615f Mon Sep 17 00:00:00 2001 From: abaevbog Date: Fri, 29 Mar 2024 06:47:27 -0400 Subject: [PATCH] fx115: fix tags autocomplete breakage (#3882) With fx115, changes from 49fe2b98d97523174889ec86b9925e4e795ca034 made the autocomplete popup appear blank when the reader tab is opened. Not re-creating the PopupAutoComplete in tagsBox makes the items from autocomplete popup visible again. But it makes the autocomplete appear below the "Add tags" popup for annotations (what 49fe2b98d97523174889ec86b9925e4e795ca034 originally fixed), and it also creates a duplicate with a new autocomplete panel at the bottom of the DOM every time autocomplete runs. The duplicate s do not have an id. Manually adding a with a whose id="PopupAutoComplete" does not create any duplicates and properly positions the popup. Fixes: #3881 --- chrome/content/zotero/elements/tagsBox.js | 20 -------------------- chrome/content/zotero/zoteroPane.xhtml | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/chrome/content/zotero/elements/tagsBox.js b/chrome/content/zotero/elements/tagsBox.js index ee95743b51..96050557a3 100644 --- a/chrome/content/zotero/elements/tagsBox.js +++ b/chrome/content/zotero/elements/tagsBox.js @@ -64,26 +64,6 @@ removeAllItemTags.disabled = !this.count; this._id('tags-context-menu').openPopupAtScreen(event.screenX, event.screenY, true); }); - - if (!document.getElementById('PopupAutoComplete')) { - let popupset = document.querySelector('popupset'); - if (!popupset) { - popupset = document.createXULElement('popupset'); - document.documentElement.append(popupset); - } - - let autocomplete = document.createXULElement('panel', { is: 'autocomplete-richlistbox-popup' }); - autocomplete.id = 'PopupAutoComplete'; - autocomplete.setAttribute('type', 'autocomplete-richlistbox'); - autocomplete.setAttribute('role', 'group'); - autocomplete.setAttribute('noautofocus', true); - autocomplete.setAttribute('hidden', true); - autocomplete.setAttribute('overflowpadding', 4); - autocomplete.setAttribute('norolluponanchor', true); - autocomplete.setAttribute('nomaxresults', true); - popupset.append(autocomplete); - } - // Register our observer with priority 101 (after Zotero.Tags) so we get updated tag colors this._notifierID = Zotero.Notifier.registerObserver(this, ['item-tag', 'setting'], 'tagsBox', 101); } diff --git a/chrome/content/zotero/zoteroPane.xhtml b/chrome/content/zotero/zoteroPane.xhtml index 5720f8ff89..6b9038ddf3 100644 --- a/chrome/content/zotero/zoteroPane.xhtml +++ b/chrome/content/zotero/zoteroPane.xhtml @@ -1305,4 +1305,18 @@ + + +