From c44b8649231e252ea4983e0de7dd79ca9fcdecfc Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 16 Mar 2019 03:21:10 -0400 Subject: [PATCH] Fix error switching creator field mode if a creator is open --- chrome/content/zotero/bindings/itembox.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index a9fa67d3d1..3757d28aca 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -968,6 +968,13 @@ if (this._getFieldValue(lastName) == this._defaultLastName) { this._setFieldValue(lastName, this._defaultFullName); } + + // If one of the creator fields is open, leave it open after swap + let activeField = this._dynamicFields.querySelector('textbox'); + if (activeField == firstName || activeField == lastName) { + this._lastTabIndex = parseInt(lastName.getAttribute('ztabindex')); + this._tabDirection = false; + } } // Switch to two-field mode else { @@ -1052,8 +1059,7 @@ fields.fieldMode = fieldMode; this.modifyCreator(index, fields); if (this.saveOnEdit) { - // See note in transformText() - this.blurOpenField().then(() => this.item.saveTx()); + this.item.saveTx(); } } ]]>