Skip to content

Commit

Permalink
Merge e3a4e5b into 1f6249e
Browse files Browse the repository at this point in the history
  • Loading branch information
gatanaso committed Jul 23, 2018
2 parents 1f6249e + e3a4e5b commit 7c7a3e7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/vaadin-combo-box-dropdown-wrapper.html
Expand Up @@ -257,7 +257,7 @@
*/
getItemLabel(item) {
let label = item ? this.get(this._itemLabelPath, item) : undefined;
if (label === undefined) {
if (label === undefined || label === null) {
label = item ? item.toString() : '';
}
return label;
Expand Down
12 changes: 12 additions & 0 deletions test/using-object-values.html
Expand Up @@ -133,6 +133,18 @@
expect(combobox.value).to.eql('default');
});

it('should use toString if provided label property is null', () => {
combobox.items = [{
custom: null
}];
combobox.items[0].toString = () => 'default';
combobox.itemLabelPath = 'custom';

selectItem(0);

expect(combobox.inputElement.value).to.eql('default');
});

it('should set the selected item when open', () => {
combobox.value = 'bar';

Expand Down

0 comments on commit 7c7a3e7

Please sign in to comment.