Skip to content

Commit a8b9248

Browse files
authored
fix(editors): AutoComplete Editor might have undefined object label (#555)
- it was throwing an error when the item dataContext did not have the label (or custom label) property inside the item dataContext
1 parent 082ed22 commit a8b9248

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/app/modules/angular-slickgrid/editors/autoCompleteEditor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export class AutoCompleteEditor implements Editor {
174174
const data = (isComplexObject) ? getDescendantProperty(item, fieldName) : item[fieldName];
175175

176176
this._currentValue = data;
177-
this._defaultTextValue = typeof data === 'string' ? data : data[this.labelName];
177+
this._defaultTextValue = typeof data === 'string' ? data : (data && data.hasOwnProperty(this.labelName) && data[this.labelName] || '');
178178
this._$editorElm.val(this._defaultTextValue);
179179
this._$editorElm.select();
180180
}

0 commit comments

Comments
 (0)