Skip to content

Commit dc62940

Browse files
authored
fix(simple-combo): display all list items when clearing the input by Space (#12692)
1 parent 8268cdd commit dc62940

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

projects/igniteui-angular/src/lib/simple-combo/simple-combo.component.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,19 @@ describe('IgxSimpleCombo', () => {
10851085
expect(combo.selection.length).toEqual(0);
10861086
});
10871087

1088+
it('should display all list items when clearing the input by Space', () => {
1089+
combo.select('Wisconsin');
1090+
fixture.detectChanges();
1091+
1092+
expect(combo.selection.length).toEqual(1);
1093+
1094+
UIInteractions.simulateTyping(' ', input, 0, 9);
1095+
fixture.detectChanges();
1096+
1097+
expect(combo.selection.length).toEqual(0);
1098+
expect(combo.filteredData.length).toEqual(combo.data.length);
1099+
});
1100+
10881101
it('should close the dropdown (if opened) when tabbing outside of the input', () => {
10891102
combo.open();
10901103
fixture.detectChanges();

projects/igniteui-angular/src/lib/simple-combo/simple-combo.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
273273
// handle clearing of input by space
274274
this.clearSelection();
275275
this._onChangeCallback(null);
276+
this.filterValue = '';
276277
}
277278
if (this.selection.length) {
278279
this.selectionService.clear(this.id);

0 commit comments

Comments
 (0)