The check: && item[this.idField] means that the item property id cannot be "0", 0, undefined or null, or?
Therefore if: items = [{text: "hello"}] or items = [{id: 0, "hello"}] would result in value.filter() always returning an empty array. new SelectItem() which checks the object and assigns the text value to the id property is then redundant as this step is never reached since this._items is empty.
Are the null checks correct in
select.ts
?The check:
&& item[this.idField]
means that the item propertyid
cannot be"0"
,0
,undefined
ornull
, or? Therefore if:items = [{text: "hello"}]
oritems = [{id: 0, "hello"}]
would result invalue.filter()
always returning an empty array.new SelectItem()
which checks the object and assigns thetext
value to theid
property is then redundant as this step is never reached sincethis._items
is empty.