From fc5aa1a6ba03e484e20d3df3e185efa11877ba7a Mon Sep 17 00:00:00 2001 From: Bogdan Abaev Date: Fri, 2 Feb 2024 15:14:12 -0500 Subject: [PATCH] win: no collection highlight if input is focused So that collections do not randomly get highlighted when one clicks Ctrl-C/Ctrl-V to copy-paste something in the itemPane --- chrome/content/zotero/zoteroPane.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 4b28d2456e..429a0ed667 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -1048,7 +1048,10 @@ var ZoteroPane = new function() // // We use Control (17) on Windows because Alt triggers the menubar; // otherwise we use Alt/Option (18) - if ((Zotero.isWin && event.keyCode == 17 && !event.altKey) || + // On windows, do not highlight when an input is focused to not interfere with + // Ctrl-C/Ctrl-V copy-paste shortcuts + let inputFocused = ["input", "textarea"].includes(document.activeElement.tagName); + if ((Zotero.isWin && event.keyCode == 17 && !event.altKey && !inputFocused) || (!Zotero.isWin && event.keyCode == 18 && !event.ctrlKey) && !event.shiftKey && !event.metaKey) { // On windows, the event is re-triggered multiple times