From 25d0cf66bdd5e637f5af22a631627b7e8637168a Mon Sep 17 00:00:00 2001 From: abaevbog Date: Mon, 15 Jul 2024 22:35:35 -0700 Subject: [PATCH] save itemPane title/abstract fields on blur (#4390) As opposed to 'change' event. Because if the field is editted and another window is focused while the cursor is in the field, the change event will be swallowed and when the field finally looses focus, it will not be saved. This may address the reported issue of edits not being saved in title and abstract fields. Addresses: #4388 --- chrome/content/zotero/elements/abstractBox.js | 2 +- chrome/content/zotero/elements/itemPaneHeader.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/elements/abstractBox.js b/chrome/content/zotero/elements/abstractBox.js index 1bcf035251..80890fb4d3 100644 --- a/chrome/content/zotero/elements/abstractBox.js +++ b/chrome/content/zotero/elements/abstractBox.js @@ -73,7 +73,7 @@ this.initCollapsibleSection(); this._abstractField = this.querySelector('editable-text'); - this._abstractField.addEventListener('change', () => this.save()); + this._abstractField.addEventListener('blur', () => this.save()); this._abstractField.ariaLabel = Zotero.getString('itemFields.abstractNote'); this._feedAbstractBrowser = this.querySelector('browser'); diff --git a/chrome/content/zotero/elements/itemPaneHeader.js b/chrome/content/zotero/elements/itemPaneHeader.js index 2a03e6414f..8767f677c1 100644 --- a/chrome/content/zotero/elements/itemPaneHeader.js +++ b/chrome/content/zotero/elements/itemPaneHeader.js @@ -114,7 +114,7 @@ this._bibEntryCache = new LRUCache(); - this.titleField.addEventListener('change', () => this.save()); + this.titleField.addEventListener('blur', () => this.save()); this.titleField.ariaLabel = Zotero.getString('itemFields.title'); this.titleField.addEventListener('contextmenu', (event) => { if (!this._item) return;