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
This commit is contained in:
abaevbog 2024-07-15 22:35:35 -07:00 committed by GitHub
parent abad33116b
commit 25d0cf66bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -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');

View file

@ -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;