Skip to content

Commit c1bdc45

Browse files
committed
fix(esf): add empty filter to filtering event
1 parent c8c3723 commit c1bdc45

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,10 @@ export class IgxFilteringService implements OnDestroy {
277277
}
278278
}
279279

280+
const emptyFilter = new FilteringExpressionsTree(null, field);
280281
const onFilteringEventArgs: IFilteringEventArgs = {
281282
owner: this.grid,
282-
filteringExpressions: null,
283+
filteringExpressions: emptyFilter,
283284
cancel: false };
284285

285286
this.grid.filtering.emit(onFilteringEventArgs);
@@ -292,7 +293,6 @@ export class IgxFilteringService implements OnDestroy {
292293
this.clear_filter(field);
293294

294295
// Wait for the change detection to update filtered data through the pipes and then emit the event.
295-
const emptyFilter = new FilteringExpressionsTree(null, field);
296296
requestAnimationFrame(() => this.grid.filteringDone.emit(emptyFilter));
297297

298298
if (field) {

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -485,9 +485,9 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
485485
GridFunctions.clickFilterCellChip(fix, columnName);
486486
GridFunctions.resetFilterRow(fix);
487487

488-
expect(grid.filtering.emit).toHaveBeenCalledWith({ owner: grid, cancel: false, filteringExpressions: null });
489-
expect(grid.filtering.emit).toHaveBeenCalledTimes(2);
490488
const emptyFilter = new FilteringExpressionsTree(null, columnName);
489+
expect(grid.filtering.emit).toHaveBeenCalledWith({ owner: grid, cancel: false, filteringExpressions: emptyFilter });
490+
expect(grid.filtering.emit).toHaveBeenCalledTimes(2);
491491
expect(grid.filteringDone.emit).toHaveBeenCalledWith(emptyFilter);
492492
expect(grid.filteringDone.emit).toHaveBeenCalledTimes(2);
493493

@@ -513,9 +513,9 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
513513
tick(100);
514514
fix.detectChanges();
515515

516-
const args = { owner: grid, cancel: false, filteringExpressions: null };
517-
expect(grid.filtering.emit).toHaveBeenCalledWith(args);
518516
const emptyFilter = new FilteringExpressionsTree(null, columnName);
517+
const args = { owner: grid, cancel: false, filteringExpressions: emptyFilter };
518+
expect(grid.filtering.emit).toHaveBeenCalledWith(args);
519519
expect(grid.filteringDone.emit).toHaveBeenCalledWith(emptyFilter);
520520
}));
521521

@@ -852,10 +852,10 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
852852

853853
expect(grid.rowList.length).toEqual(8);
854854

855-
args.filteringExpressions = null;
855+
const emptyFilter = new FilteringExpressionsTree(null, columnName);
856+
args.filteringExpressions = emptyFilter;
856857
expect(grid.filtering.emit).toHaveBeenCalledWith(args);
857858
expect(grid.filtering.emit).toHaveBeenCalledTimes(2);
858-
const emptyFilter = new FilteringExpressionsTree(null, columnName);
859859
expect(grid.filteringDone.emit).toHaveBeenCalledWith(emptyFilter);
860860
expect(grid.filteringDone.emit).toHaveBeenCalledTimes(2);
861861
}));

0 commit comments

Comments
 (0)