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
This commit is contained in:
parent
579106c3af
commit
fc5aa1a6ba
1 changed files with 4 additions and 1 deletions
|
@ -1048,7 +1048,10 @@ var ZoteroPane = new function()
|
||||||
//
|
//
|
||||||
// We use Control (17) on Windows because Alt triggers the menubar;
|
// We use Control (17) on Windows because Alt triggers the menubar;
|
||||||
// otherwise we use Alt/Option (18)
|
// 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)
|
(!Zotero.isWin && event.keyCode == 18 && !event.ctrlKey)
|
||||||
&& !event.shiftKey && !event.metaKey) {
|
&& !event.shiftKey && !event.metaKey) {
|
||||||
// On windows, the event is re-triggered multiple times
|
// On windows, the event is re-triggered multiple times
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue