Skip to content

Commit 459914c

Browse files
author
Hristo Popov
authored
Merge branch '9.0.x' into hPopov/refactor-grid-row-selectors-90x
2 parents 7d7c687 + 6371e1d commit 459914c

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

projects/igniteui-angular/src/lib/grids/filtering/base/grid-filtering-row.component.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -462,12 +462,14 @@ export class IgxGridFilteringRowComponent implements AfterViewInit {
462462
this.expressionsList[0].expression.searchVal === null &&
463463
this.expressionsList[0].expression.condition.isUnary === false) {
464464
this.filteringService.getExpressions(this.column.field).pop();
465+
466+
this.filter();
465467
} else {
466-
this.expressionsList.forEach((item) => {
467-
if (item.expression.searchVal === null && !item.expression.condition.isUnary) {
468-
this.filteringService.removeExpression(this.column.field, this.expressionsList.indexOf(item));
469-
}
470-
});
468+
const condToRemove = this.expressionsList.filter(ex => ex.expression.searchVal === null && !ex.expression.condition.isUnary);
469+
if (condToRemove && condToRemove.length > 0) {
470+
condToRemove.forEach(c => this.filteringService.removeExpression(this.column.field, this.expressionsList.indexOf(c)));
471+
this.filter();
472+
}
471473
}
472474

473475
this.filteringService.isFilterRowVisible = false;

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1969,6 +1969,23 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
19691969
const activeFilterIcon = header.nativeElement.querySelector('.igx-excel-filter__icon--filtered');
19701970
expect(activeFilterIcon).toBeDefined('no active filter icon was found');
19711971
}));
1972+
1973+
it('Should clear non-unary conditions with null searchVal when close', fakeAsync(() => {
1974+
GridFunctions.clickFilterCellChip(fix, 'ProductName');
1975+
fix.detectChanges();
1976+
1977+
GridFunctions.openFilterDD(fix.debugElement);
1978+
const dropdownList = fix.debugElement.query(By.css('div.igx-drop-down__list.igx-toggle'));
1979+
GridFunctions.selectFilteringCondition('Empty', dropdownList);
1980+
fix.detectChanges();
1981+
GridFunctions.openFilterDD(fix.debugElement);
1982+
GridFunctions.selectFilteringCondition('Contains', dropdownList);
1983+
fix.detectChanges();
1984+
GridFunctions.closeFilterRow(fix);
1985+
1986+
const headerChip = GridFunctions.getFilterChipsForColumn('ProductName', fix);
1987+
expect(headerChip.length).toBe(1);
1988+
}));
19721989
});
19731990

19741991
describe('Integration scenarios', () => {

projects/igniteui-angular/src/lib/select/select.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
<igx-input-group #inputGroup class="input-group" [disabled]="disabled" (click)="toggle()" [type]="type" [displayDensity]="displayDensity">
1+
<igx-input-group #inputGroup class="input-group" (click)="toggle()" [type]="type" [displayDensity]="displayDensity">
22
<ng-container ngProjectAs="[igxLabel]">
33
<ng-content select="[igxLabel]"></ng-content>
44
</ng-container>
55
<ng-container ngProjectAs="igx-prefix">
66
<ng-content select="igx-prefix,[igxPrefix]"></ng-content>
77
</ng-container>
88
<input #input class="input" type="text" igxInput [igxSelectItemNavigation]="this"
9+
[disabled]="disabled"
910
readonly="true"
1011
[attr.placeholder]="this.placeholder"
1112
[value]="this.selectionValue"

0 commit comments

Comments
 (0)