fix keyboard focus not landing on feeds itemTree (#4495)

Do not use specific "#item-tree-main-default" selector to
find the itemTree node to focus since a different id
can be set for the table, e.g for the list of feeds.

Use a more general "zotero-items-tree .virtualized-table"
selector to focus the itemTree on tab from quickSearch
and on Escape keypress from an editable-text of itemPane.

Fixes: #4494
This commit is contained in:
abaevbog 2024-08-04 21:39:39 -07:00 committed by GitHub
parent 256efd3195
commit c5027106c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -568,7 +568,7 @@
// On Escape/Enter on editable-text, return focus to the item tree or reader
if (event.key == "Escape" || (event.key == "Enter" && event.target.classList.contains('input'))) {
if (isLibraryTab) {
document.getElementById('item-tree-main-default').focus();
document.querySelector('#zotero-items-tree .virtualized-table').focus();
}
else {
let reader = Zotero.Reader.getByTabID(Zotero_Tabs.selectedID);

View file

@ -407,7 +407,7 @@ var ZoteroPane = new function()
ShiftTab: () => {
document.getElementById("zotero-tb-search")._searchModePopup.flattenedTreeParentNode.focus();
},
Tab: () => document.getElementById('item-tree-main-default')
Tab: () => itemTree.querySelector(".virtualized-table")
},
'zotero-tb-search-dropmarker': {
ArrowNext: () => null,