diff --git a/chrome/content/zotero/tabs.js b/chrome/content/zotero/tabs.js index 3ed4fdfde7..6d3907d9b4 100644 --- a/chrome/content/zotero/tabs.js +++ b/chrome/content/zotero/tabs.js @@ -1005,6 +1005,10 @@ var Zotero_Tabs = new function () { this.refreshTabsMenuList(); }; + this.resetFocusIndex = (_) => { + this._tabsMenuFocusedIndex = 0; + }; + /** * Focus on the element in the tabs menu with [tabindex=tabIndex] if given @@ -1046,6 +1050,7 @@ var Zotero_Tabs = new function () { * - ArrowUp from the filter field focuses the last tab * - Home/PageUp focuses the filter field * - End/PageDown focues the last tab title + * - CMD-f will focus the input field */ this.handleTabsMenuKeyPress = function (event) { let tabindex = this._tabsMenuFocusedIndex; @@ -1114,5 +1119,14 @@ var Zotero_Tabs = new function () { } event.target.click(); } + else if (["ArrowLeft", "ArrowRight"].includes(event.key)) { + event.preventDefault(); + event.stopPropagation(); + } + else if (event.key == "f" && (Zotero.isMac ? event.metaKey : event.ctrlKey)) { + focusTabsMenuEntry(0); + event.preventDefault(); + event.stopPropagation(); + } }; }; diff --git a/chrome/content/zotero/zoteroPane.xhtml b/chrome/content/zotero/zoteroPane.xhtml index 0b0a61b96c..9ef7b73482 100644 --- a/chrome/content/zotero/zoteroPane.xhtml +++ b/chrome/content/zotero/zoteroPane.xhtml @@ -817,6 +817,7 @@