From 67e9e4b994503c0b03fa6254564df7927b3e6213 Mon Sep 17 00:00:00 2001 From: Ghislain Beaulac Date: Wed, 5 Aug 2020 15:56:07 -0400 Subject: [PATCH] fix(editors): AutoComplete Editor might have undefined object label - it was throwing an error when the item dataContext did not have the label (or custom label) property inside the item dataContext --- src/app/modules/angular-slickgrid/editors/autoCompleteEditor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/modules/angular-slickgrid/editors/autoCompleteEditor.ts b/src/app/modules/angular-slickgrid/editors/autoCompleteEditor.ts index 84bb7d1ec..580f4a686 100644 --- a/src/app/modules/angular-slickgrid/editors/autoCompleteEditor.ts +++ b/src/app/modules/angular-slickgrid/editors/autoCompleteEditor.ts @@ -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(); }