From bc62bbfdda3b2b33365c7f25f8897c1d01316525 Mon Sep 17 00:00:00 2001 From: abaevbog Date: Thu, 7 Nov 2024 21:13:36 -0800 Subject: [PATCH] do not handle tab out of reader iframe in window (#4824) Only move focus out of the reader iframe on tab/shift-tab if the reader instance is opened within a tab, meaning the sync button and the contextPane exist. If the reader is opened in a standalone window, do nothing. Fixes: #4823 --- chrome/content/zotero/xpcom/reader.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/reader.js b/chrome/content/zotero/xpcom/reader.js index d950787967..aacdd3c2bc 100644 --- a/chrome/content/zotero/xpcom/reader.js +++ b/chrome/content/zotero/xpcom/reader.js @@ -502,12 +502,14 @@ class ReaderInstance { win.ZoteroContextPane.togglePane(); }, onToolbarShiftTab: () => { - // Shift-tab from the toolbar focuses the sync button + // Shift-tab from the toolbar focuses the sync button (if reader instance is opened in a tab) + if (!this.tabID) return; let win = Zotero.getMainWindow(); win.document.getElementById("zotero-tb-sync").focus(); }, onIframeTab: () => { - // Tab after the last tabstop will focus the contextPane + // Tab after the last tabstop will focus the contextPane (if reader instance is opened in a tab) + if (!this.tabID) return; let win = Zotero.getMainWindow(); let focused = win.ZoteroContextPane.focus(); // If context pane wasn't focused (e.g. it's collapsed), focus the tab bar