From 64b80685048960482d700e5ce4c8842b955ec53e Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Wed, 10 Jan 2024 11:00:01 -0500 Subject: [PATCH] Focus item tree on Escape in empty Quick Search textbox --- chrome/content/zotero/zoteroPane.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 2c055a2423..fcef72ac5d 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -2740,8 +2740,13 @@ var ZoteroPane = new function() */ this.handleSearchKeypress = function (textbox, event) { if (event.keyCode == event.DOM_VK_ESCAPE) { - textbox.searchTextbox.value = ''; - this.search(); + if (textbox.searchTextbox.value) { + textbox.searchTextbox.value = ''; + this.search(); + } + else { + this.itemsView.focus(); + } } else if (event.keyCode == event.DOM_VK_RETURN) { this.search(true);