Skip to content

Commit fb8661e

Browse files
committed
feat(igx-grid): Close filter row on Esc, #2979
1 parent ab3b06e commit fb8661e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,13 @@ export class IgxGridFilteringRowComponent implements AfterViewInit, OnDestroy {
172172
}
173173
}
174174

175+
@HostListener('keydown.esc', ['$event'])
176+
public onEscKeydown(event) {
177+
event.preventDefault();
178+
event.stopPropagation();
179+
this.close();
180+
}
181+
175182
get disabled(): boolean {
176183
return !(this.column.filteringExpressionsTree && this.column.filteringExpressionsTree.filteringOperands.length > 0);
177184
}
@@ -254,6 +261,9 @@ export class IgxGridFilteringRowComponent implements AfterViewInit, OnDestroy {
254261
this.input.nativeElement.blur();
255262
this.inputGroupPrefix.nativeElement.focus();
256263
this.toggleConditionsDropDown(this.inputGroupPrefix.nativeElement);
264+
} else if (event.key === KEYS.ESCAPE || event.key === KEYS.ESCAPE_IE) {
265+
event.preventDefault();
266+
this.close();
257267
}
258268
event.stopPropagation();
259269
}

0 commit comments

Comments
 (0)