Skip to content

Commit 751fe0f

Browse files
committed
fix(esf): add test to cover the scenario + add if statement
1 parent 49823a4 commit 751fe0f

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

projects/igniteui-angular/src/lib/grids/filtering/excel-style/excel-style-search.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ export class IgxExcelStyleSearchComponent implements AfterViewInit, OnDestroy {
131131
});
132132

133133
esf.listDataLoaded.pipe(takeUntil(this.destroy$)).subscribe(() => {
134-
this.clearInput();
134+
if (this.searchValue) {
135+
this.clearInput();
136+
}
135137
});
136138
}
137139

projects/igniteui-angular/src/lib/grids/grid/grid-filtering-ui.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4571,6 +4571,21 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
45714571
GridSelectionFunctions.verifyColumnAndCellsSelected(columnId, false);
45724572

45734573
});
4574+
4575+
it('Should reset esf menu with templates on column change', fakeAsync(() => {
4576+
GridFunctions.clickExcelFilterIconFromCode(fix, grid, 'Downloads');
4577+
4578+
let inputNativeElement = GridFunctions.getExcelStyleSearchComponentInput(fix);
4579+
UIInteractions.clickAndSendInputElementValue(inputNativeElement, 20, fix);
4580+
4581+
const listItems = GridFunctions.getExcelStyleSearchComponentListItems(fix);
4582+
expect(listItems.length).toBe(2, 'incorrect rendered list items count');
4583+
4584+
GridFunctions.clickExcelFilterIconFromCode(fix, grid, 'ProductName');
4585+
4586+
inputNativeElement = GridFunctions.getExcelStyleSearchComponentInput(fix);
4587+
expect(inputNativeElement.value).toBe('', 'input value didn\'t reset');
4588+
}));
45744589
});
45754590

45764591
describe('Load values on demand', () => {

0 commit comments

Comments
 (0)