From 2ef5afdd9c10688090c05001d85fb8c0818847d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= Date: Mon, 30 Aug 2021 09:38:02 +0300 Subject: [PATCH] Disable typing navigation with modifier keys pressed. Closes #2170 --- chrome/content/zotero/collectionTree.jsx | 2 +- chrome/content/zotero/itemTree.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/collectionTree.jsx b/chrome/content/zotero/collectionTree.jsx index 9f6f2292eb..73b3343e2e 100644 --- a/chrome/content/zotero/collectionTree.jsx +++ b/chrome/content/zotero/collectionTree.jsx @@ -153,7 +153,7 @@ var CollectionTree = class CollectionTree extends LibraryTree { else if (event.key == "F2" && !Zotero.isMac && treeRow.isCollection()) { this.handleActivate(event, [this.selection.focused]); } - else if (event.key.length == 1) { + else if (event.key.length == 1 && !(event.ctrlKey || event.metaKey || !event.altKey)) { this.handleTyping(event.key); } return true; diff --git a/chrome/content/zotero/itemTree.jsx b/chrome/content/zotero/itemTree.jsx index 0202218a00..776be22c57 100644 --- a/chrome/content/zotero/itemTree.jsx +++ b/chrome/content/zotero/itemTree.jsx @@ -931,7 +931,7 @@ var ItemTree = class ItemTree extends LibraryTree { this.collapseAllRows(); return false; } - else if (!event.ctrlKey && !event.metaKey && (event.key.length == 1 && (event.key != " " || this.selection.isSelected(this.selection.focused)))) { + else if (!(event.ctrlKey || event.metaKey || !event.altKey) && event.key.length == 1 && (event.key != " " || this._typingString.length > 1)) { this.handleTyping(event.key); return false; }