fix wrong suggestions for creators
Fix to a glitch where after switching creator field mode, the autocomplete suggestions for creators would still be for the old mode. This only happened if the field mode was changed on an empty, unsaved creator row.
This commit is contained in:
parent
c6799bc3c2
commit
fe01113935
1 changed files with 7 additions and 12 deletions
|
@ -1255,21 +1255,16 @@
|
|||
firstName.sizeToContent();
|
||||
lastName.sizeToContent();
|
||||
this.modifyCreator(rowIndex, fields);
|
||||
if (this.saveOnEdit) {
|
||||
let activeField = this.getFocusedTextArea();
|
||||
if (activeField !== null && activeField !== firstName && activeField !== lastName) {
|
||||
this.blurOpenField();
|
||||
}
|
||||
else {
|
||||
this.item.saveTx();
|
||||
}
|
||||
}
|
||||
else {
|
||||
// If the creator is saved, autocomplete will be set in refresh()
|
||||
// Otherwise, we'll reset it here.
|
||||
// For empty unsaved creator rows, update their autocomplete setting so that
|
||||
// e.g fullnames are not suggested after switch to first-last name mode.
|
||||
// Otherwise, just save the item and appropriate autocomplete modes will be set in render()
|
||||
if (row.querySelector("[unsaved=true]")) {
|
||||
this.addAutocompleteToElement(firstName);
|
||||
this.addAutocompleteToElement(lastName);
|
||||
}
|
||||
else {
|
||||
this.item.saveTx();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue