diff --git a/chrome/content/zotero/elements/itemPaneSection.js b/chrome/content/zotero/elements/itemPaneSection.js index a8e8d14847..2d06f75fc5 100644 --- a/chrome/content/zotero/elements/itemPaneSection.js +++ b/chrome/content/zotero/elements/itemPaneSection.js @@ -52,6 +52,10 @@ class ItemPaneSectionElementBase extends XULElementBase { this.setAttribute('tabType', tabType); } + get open() { + return this._section?.open || false; + } + connectedCallback() { super.connectedCallback(); if (!this.render && !this.asyncRender) { diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 03f78d4bce..06d9d52d97 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -1305,6 +1305,11 @@ var ZoteroPane = new function() var type = mru ? mru.split(',')[0] : 'book'; await ZoteroPane.newItem(Zotero.ItemTypes.getID(type)); let itemBox = document.getElementById('zotero-editpane-item-box'); + // If the info pane is collapsed, focus the title in the header + if (!itemBox.open) { + document.querySelector("#zotero-item-pane-header editable-text").focus(); + return; + } var menu = itemBox.itemTypeMenu; // If the new item's type is changed immediately, update the MRU var handleTypeChange = function () {