From a1d3eea8b25c5c2bc6cdb257b27f8285a198c17a Mon Sep 17 00:00:00 2001 From: MinhHaDuong Date: Tue, 22 Sep 2026 11:44:30 +0200 Subject: [PATCH] Let toolbar focus routing skip disabled plugin buttons --- chrome/content/zotero/zoteroPane.js | 3 +-- test/tests/zoteroPaneTest.js | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index e76f6b82a1..7b75e60bed 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -178,8 +178,7 @@ var ZoteroPane = new function () { // toolbarbutton. Read the current buttons for each key event. let pluginButtons = () => [...document.querySelectorAll( '#zotero-items-toolbar > toolbarbutton[tabindex="0"]' - )].filter(button => !button.disabled && !button.hidden - && getComputedStyle(button).display !== 'none'); + )]; let titleBar = document.getElementById("zotero-title-bar"); let itemTree = document.getElementById("zotero-items-tree"); let collectionsTree = document.getElementById("zotero-collections-tree"); diff --git a/test/tests/zoteroPaneTest.js b/test/tests/zoteroPaneTest.js index 87e63e8574..a3f92d272b 100644 --- a/test/tests/zoteroPaneTest.js +++ b/test/tests/zoteroPaneTest.js @@ -1964,6 +1964,11 @@ describe("ZoteroPane", function () { buttons[0].style.display = 'none'; paneToggle.dispatchEvent(tab); assert.equal(doc.activeElement, buttons[1]); + buttons[0].style.display = ''; + buttons[0].disabled = true; + doc.getElementById('zotero-tb-add').focus(); + buttons[0].dispatchEvent(tab); + assert.equal(doc.activeElement, buttons[1]); } finally { buttons.forEach(button => button.remove());