Skip to content

Commit 0a2c7bc

Browse files
authored
Merge branch '8.1.x' into mkirova/fix-4416-master
2 parents c93644e + aa0cb8c commit 0a2c7bc

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class IgxExcelStyleSearchFilterPipe implements PipeTransform {
1919

2020
searchText = searchText.toLowerCase();
2121
const result = items.filter((it, i) => (i === 0 && it.isSpecial) ||
22-
(it.value || it.value === 0) &&
22+
(it.value !== null && it.value !== undefined) &&
2323
it.value.toString().toLowerCase().indexOf(searchText) > -1);
2424

2525
return result.length > 1 ? result : [];

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4420,6 +4420,26 @@ describe('IgxGrid - Filtering actions - Excel style filtering', () => {
44204420
fix.detectChanges();
44214421
}));
44224422

4423+
it('Should include \'false\' value in results when searching.', fakeAsync(() => {
4424+
// Open excel style custom filtering dialog.
4425+
GridFunctions.clickExcelFilterIcon(fix, 'Released');
4426+
fix.detectChanges();
4427+
4428+
// Type string in search box.
4429+
const searchComponent = GridFunctions.getExcelStyleSearchComponent(fix);
4430+
const inputNativeElement = searchComponent.querySelector('.igx-input-group__input');
4431+
sendInputNativeElement(inputNativeElement, 'false', fix);
4432+
tick(100);
4433+
fix.detectChanges();
4434+
4435+
// Verify that the first item is 'Select All' and the second item is 'false'.
4436+
const listItems = GridFunctions.sortNativeElementsVertically(
4437+
Array.from(searchComponent.querySelectorAll('igx-list-item')));
4438+
expect(listItems.length).toBe(2, 'incorrect rendered list items count');
4439+
expect(listItems[0].innerText).toBe('Select All');
4440+
expect(listItems[1].innerText).toBe('false');
4441+
}));
4442+
44234443
it('should scroll items in search list correctly', (async () => {
44244444
// Add additional rows as prerequisite for the test
44254445
for (let index = 0; index < 30; index++) {

0 commit comments

Comments
 (0)