From eed7acff08460f243cbea1ced2991a467038dbc2 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Mon, 20 May 2024 10:34:13 -0400 Subject: [PATCH] Ignore sort keyboard shortcuts in non-library tabs Fixes #4140 --- chrome/content/zotero/zoteroPane.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index f338e5359e..91a8affd3c 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -1638,7 +1638,11 @@ var ZoteroPane = new function() let key = sortSubmenuKeys.children[i]; key.setAttribute('modifiers', Zotero.isMac ? 'accel alt control' : 'alt'); key.setAttribute('key', (i + 1) % 10); - key.addEventListener('command', () => ZoteroPane.itemsView.toggleSort(i, true)); + key.addEventListener('command', () => { + if (Zotero_Tabs.selectedType === 'library') { + ZoteroPane.itemsView.toggleSort(i, true); + } + }); } } catch (e) {