From fbbe9625fca81ea2e8d57f47f0e784ee1af5f130 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Tue, 16 Jan 2024 13:58:12 -0500 Subject: [PATCH] Focus new tag when popup is opened --- chrome/content/zotero/xpcom/reader.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/xpcom/reader.js b/chrome/content/zotero/xpcom/reader.js index 8249f81a81..7899fac8c6 100644 --- a/chrome/content/zotero/xpcom/reader.js +++ b/chrome/content/zotero/xpcom/reader.js @@ -873,12 +873,14 @@ class ReaderInstance { let rect = this._iframe.getBoundingClientRect(); x += rect.left; y += rect.top; - setTimeout(() => menupopup.openPopup(null, 'before_start', x, y, true)); tagsbox.mode = 'edit'; tagsbox.item = item; - if (tagsbox.mode == 'edit' && tagsbox.count == 0) { - tagsbox.newTag(); - } + menupopup.openPopup(null, 'before_start', x, y, true); + setTimeout(() => { + if (tagsbox.count == 0) { + tagsbox.newTag(); + } + }); } async _openContextMenu({ x, y, itemGroups }) {