Ensure read-only fields don't save on blur (#5468)

Fixes tabbing out of Scaffold's abstract box causing the test item to be
added to the user's library.

And use same format as itemPaneHeader.js in abstractBox.js.
This commit is contained in:
Abe Jellinek 2025-08-13 21:59:26 -06:00 • committed by GitHub
parent f3227275b1
commit a993ac74f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 3 deletions

View file

@ -89,9 +89,15 @@
}
async save() {
if (this.item) {
this.item.setField('abstractNote', this._abstractField.value);
await this.item.saveTx();
if (!this.editable) {
return;
}
if (this._item) {
if (!this._item.itemID) {
throw new Error('Item has not been added to library');
}
this._item.setField('abstractNote', this._abstractField.value);
await this._item.saveTx();
}
this._forceRenderAll();
}

View file

@ -180,7 +180,13 @@
}
async save() {
if (!this.editable) {
return;
}
if (this._item) {
if (!this._item.itemID) {
throw new Error('Item has not been added to library');
}
this._item.setField(this._titleFieldID, this.titleField.value);
await this._item.saveTx();
}