Skip to content

Commit 9b60541

Browse files
committed
feat(IgxGrid): close advanced filter dialog when press escape #7243
1 parent 3c0a42e commit 9b60541

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

projects/igniteui-angular/src/lib/grids/filtering/advanced-filtering/advanced-filtering-dialog.component.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,9 +797,11 @@ export class IgxAdvancedFilteringDialogComponent implements AfterViewInit, OnDes
797797
*/
798798
public onKeyDown(eventArgs: KeyboardEvent) {
799799
eventArgs.stopPropagation();
800-
if (!this.contextMenuToggle.collapsed &&
801-
(eventArgs.key === KEYS.ESCAPE || eventArgs.key === KEYS.ESCAPE_IE)) {
800+
const key = eventArgs.key;
801+
if (!this.contextMenuToggle.collapsed && (key === KEYS.ESCAPE || key === KEYS.ESCAPE_IE)) {
802802
this.clearSelection();
803+
} else if (key === KEYS.ESCAPE || key === KEYS.ESCAPE_IE) {
804+
this.closeDialog();
803805
}
804806
}
805807

@@ -1072,6 +1074,9 @@ export class IgxAdvancedFilteringDialogComponent implements AfterViewInit, OnDes
10721074
if (this._overlayComponentId) {
10731075
this._overlayService.hide(this._overlayComponentId);
10741076
}
1077+
if (this.grid.navigation.activeNode && this.grid.navigation.activeNode.row === -1) {
1078+
(this.grid as any).theadRow.nativeElement.focus();
1079+
}
10751080
}
10761081

10771082
/**

0 commit comments

Comments
 (0)