Skip to content

Commit

Permalink
feat(igx-grid): Close filter row on Esc, #2979
Browse files Browse the repository at this point in the history
  • Loading branch information
sstoyanovIG committed Nov 12, 2018
1 parent e100e62 commit 6adf3d7
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,13 @@ export class IgxGridFilteringRowComponent implements AfterViewInit, OnDestroy {
}
}

@HostListener('keydown.esc', ['$event'])
public onEscKeydown(event) {
event.preventDefault();
event.stopPropagation();
this.close();
}

get disabled(): boolean {
return !(this.column.filteringExpressionsTree && this.column.filteringExpressionsTree.filteringOperands.length > 0);
}
Expand Down Expand Up @@ -254,6 +261,9 @@ export class IgxGridFilteringRowComponent implements AfterViewInit, OnDestroy {
this.input.nativeElement.blur();
this.inputGroupPrefix.nativeElement.focus();
this.toggleConditionsDropDown(this.inputGroupPrefix.nativeElement);
} else if (event.key === KEYS.ESCAPE || event.key === KEYS.ESCAPE_IE) {
event.preventDefault();
this.close();
}
event.stopPropagation();
}
Expand Down

0 comments on commit 6adf3d7

Please sign in to comment.