diff --git a/chrome/content/zotero/elements/contextNotesList.js b/chrome/content/zotero/elements/contextNotesList.js index 969aebc790..7721ee4cf7 100644 --- a/chrome/content/zotero/elements/contextNotesList.js +++ b/chrome/content/zotero/elements/contextNotesList.js @@ -202,14 +202,16 @@ }; // ArrowUp/Down navigation between notes - // Tab from a note-row focuses sidenav, Shift-Tab from a note focuses the section header + // Tab from a note-row focuses sidenav, Shift-Tab from a note focuses the twisty of the section header // Tab from twisty icon into the notes list will try to refocus the last focused note _handleKeyDown = (event) => { - if (event.key == "Tab" && event.target.classList.contains("twisty")) { + if (event.key == "Tab" && !event.shiftKey && event.target.classList.contains("twisty")) { let section = event.target.closest("collapsible-section"); if (this._lastFocusedNote && section.contains(this._lastFocusedNote)) { - this.refocusLastFocusedNote(); - event.preventDefault(); + let refocused = this.refocusLastFocusedNote(); + if (refocused) { + event.preventDefault(); + } } } if (event.target.tagName !== "note-row" && !event.target.classList.contains("more")) return; @@ -225,8 +227,7 @@ event.preventDefault(); } else if (event.key == "Tab" && event.shiftKey) { - Services.focus.moveFocus(window, event.target.closest("collapsible-section"), - Services.focus.MOVEFOCUS_FORWARD, 0); + event.target.closest("collapsible-section").querySelector(".twisty").focus(); event.preventDefault(); } }; diff --git a/chrome/content/zotero/elements/itemPaneSidenav.js b/chrome/content/zotero/elements/itemPaneSidenav.js index 9a9a968da9..89b918f6ff 100644 --- a/chrome/content/zotero/elements/itemPaneSidenav.js +++ b/chrome/content/zotero/elements/itemPaneSidenav.js @@ -392,7 +392,7 @@ if (event.key == "Tab" && event.shiftKey) { event.preventDefault(); if (this._contextNotesPaneVisible && this._contextNotesPane.selectedPanel.mode == "notesList") { - let focusHandled = this._contextNotesPane.selectedPanel.focus(); + let focusHandled = this._contextNotesPane.selectedPanel.notesList.refocusLastFocusedNote(); if (focusHandled) return; } // Shift-Tab out of sidenav to itemPane diff --git a/chrome/content/zotero/elements/notesContext.js b/chrome/content/zotero/elements/notesContext.js index dba5b19932..de506c4c30 100644 --- a/chrome/content/zotero/elements/notesContext.js +++ b/chrome/content/zotero/elements/notesContext.js @@ -152,10 +152,7 @@ focus() { if (this.mode == "notesList") { - let refocused = this.notesList.refocusLastFocusedNote(); - if (!refocused) { - this.input.focus(); - } + this.input.focus(); return true; } else {