Select Items Dialog: restore tab order (#4442)
After redesign, tab order became: quickSearch -> itemTree -> cancel and accept buttons -> collectionTree. This restores original tab sequence: quickSearch -> collectionTree -> itemsTree -> cancel and accept buttons.
This commit is contained in:
parent
6a99fb673a
commit
8b67fbcdce
1 changed files with 13 additions and 0 deletions
|
@ -104,6 +104,19 @@ var doLoad = async function () {
|
|||
|
||||
document.addEventListener('dialogaccept', doAccept);
|
||||
|
||||
if (isSelectItemsDialog) {
|
||||
// Set proper tab order. It is only needed in selectItemsDialog -- other dialogs' focus order is correct
|
||||
document.querySelector("#zotero-tb-search").searchModePopup.parentNode.setAttribute("tabindex", 1);
|
||||
document.querySelector("#zotero-tb-search").searchTextbox.inputField.setAttribute("tabindex", 2);
|
||||
document.querySelector("#collection-tree").setAttribute("tabindex", 3);
|
||||
document.querySelector("#zotero-items-tree .virtualized-table").setAttribute("tabindex", 4);
|
||||
// On Windows, buttons are in a different order than on macOS, so set tabindex accordingly
|
||||
let nextButtonTabindex = 5;
|
||||
for (let button of [...document.querySelectorAll("button[dlgtype]:not([hidden])")]) {
|
||||
button.setAttribute("tabindex", nextButtonTabindex++);
|
||||
}
|
||||
}
|
||||
|
||||
// Used in tests
|
||||
loaded = true;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue