Fix error switching creator field mode if a creator is open

This commit is contained in:
Dan Stillman 2019-03-16 03:21:10 -04:00
parent 9d564f022d
commit c44b864923

View file

@ -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();
}
}
]]>