Skip to content

Commit

Permalink
fix(editors): AutoComplete Editor might have undefined object label (#…
Browse files Browse the repository at this point in the history
…555)

- it was throwing an error when the item dataContext did not have the label (or custom label) property inside the item dataContext
  • Loading branch information
ghiscoding committed Aug 6, 2020
1 parent 082ed22 commit a8b9248
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export class AutoCompleteEditor implements Editor {
const data = (isComplexObject) ? getDescendantProperty(item, fieldName) : item[fieldName];

this._currentValue = data;
this._defaultTextValue = typeof data === 'string' ? data : data[this.labelName];
this._defaultTextValue = typeof data === 'string' ? data : (data && data.hasOwnProperty(this.labelName) && data[this.labelName] || '');
this._$editorElm.val(this._defaultTextValue);
this._$editorElm.select();
}
Expand Down

0 comments on commit a8b9248

Please sign in to comment.