Focus item tree on Escape in empty Quick Search textbox

This commit is contained in:
Abe Jellinek 2024-01-10 11:00:01 -05:00 committed by Dan Stillman
parent 0d37d2752c
commit 64b8068504

View file

@ -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);