Skip to content

Commit fcb9a24

Browse files
authored
Merge branch 'master' into filtering-refactor
2 parents 3c300b9 + f7808b7 commit fcb9a24

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

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

+8
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,14 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy, AfterView
316316
return true;
317317
}
318318

319+
if (this.filterValues.size === 1) {
320+
const firstValue = this.filterValues.values().next().value;
321+
322+
if (!firstValue && firstValue !== 0) {
323+
return true;
324+
}
325+
}
326+
319327
for (let index = 0; index < this.uniqueValues.length; index++) {
320328
if (this.filterValues.has(this.uniqueValues[index])) {
321329
return true;

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

+19
Original file line numberDiff line numberDiff line change
@@ -3929,6 +3929,25 @@ describe('IgxGrid - Filtering actions - Excel style filtering', () => {
39293929
[ true, true, true ]);
39303930
}));
39313931

3932+
it('Should select (Blanks) when the blank value is empty string.', fakeAsync(() => {
3933+
grid.data[0].AnotherField = '';
3934+
fix.detectChanges();
3935+
3936+
openExcelMenu(fix, 5);
3937+
verifyExcelStyleFilterAvailableOptions(grid,
3938+
[ 'Select All', '(Blanks)', 'a', 'custom' ],
3939+
[ true, true, true, true ]);
3940+
3941+
toggleExcelStyleFilteringItems(fix, grid, true, 2, 3);
3942+
3943+
expect(grid.rowList.length).toBe(1);
3944+
3945+
openExcelMenu(fix, 5);
3946+
verifyExcelStyleFilterAvailableOptions(grid,
3947+
[ 'Select All', '(Blanks)', 'a', 'custom' ],
3948+
[ null, true, false, false ]);
3949+
}));
3950+
39323951
it('Should display the ESF based on the filterIcon within the grid', async() => {
39333952
// Test prerequisites
39343953
grid.width = '800px';

0 commit comments

Comments
 (0)