diff --git a/chrome/content/zotero/bindings/attachmentbox.xml b/chrome/content/zotero/bindings/attachmentbox.xml index 2a25c1ae7c..a732e9a653 100644 --- a/chrome/content/zotero/bindings/attachmentbox.xml +++ b/chrome/content/zotero/bindings/attachmentbox.xml @@ -169,7 +169,9 @@ } var noteEditor = this._id('attachment-note-editor') - if (extraData && extraData[id] + if (extraData + && extraData[id] + && extraData[id].noteEditorID && extraData[id].noteEditorID == noteEditor.instanceID) { //Zotero.debug("Skipping notification from current attachment note field"); continue; diff --git a/test/tests/itemPaneTest.js b/test/tests/itemPaneTest.js index ce8c2219d1..78cf8df97e 100644 --- a/test/tests/itemPaneTest.js +++ b/test/tests/itemPaneTest.js @@ -270,6 +270,19 @@ describe("Item pane", function () { var label = itemBox._id('fileName'); assert.equal(label.value, newName); }) + + it("should update on attachment title change", async function () { + var file = getTestDataDirectory(); + file.append('test.png'); + var item = await Zotero.Attachments.importFromFile({ file }); + var newTitle = 'New Title'; + item.setField('title', newTitle); + await item.saveTx(); + + var itemBox = doc.getElementById('zotero-attachment-box'); + var label = itemBox._id('title'); + assert.equal(label.textContent, newTitle); + }) })