From 9f8a62d728acd3983f5403b256f6fa4653d6aab6 Mon Sep 17 00:00:00 2001 From: SAndreeva Date: Mon, 14 Jan 2019 12:02:05 +0200 Subject: [PATCH] fix(filtering): prevent improper event firing in IE for JP #3577 --- .../grid-filtering-row.component.html | 2 ++ .../filtering/grid-filtering-row.component.ts | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/projects/igniteui-angular/src/lib/grids/filtering/grid-filtering-row.component.html b/projects/igniteui-angular/src/lib/grids/filtering/grid-filtering-row.component.html index b878e9fdc51..bb0b821d90d 100644 --- a/projects/igniteui-angular/src/lib/grids/filtering/grid-filtering-row.component.html +++ b/projects/igniteui-angular/src/lib/grids/filtering/grid-filtering-row.component.html @@ -29,6 +29,8 @@ [type]="type" [readonly]="isUnaryCondition" (click)="onInputClick()" + (compositionstart)="onCompositionStart()" + (compositionend)="onCompositionEnd()" (keydown)="onInputKeyDown($event)" (keyup)="onInputKeyUp($event)"/> diff --git a/projects/igniteui-angular/src/lib/grids/filtering/grid-filtering-row.component.ts b/projects/igniteui-angular/src/lib/grids/filtering/grid-filtering-row.component.ts index c9c9482f630..b2329dc7b9f 100644 --- a/projects/igniteui-angular/src/lib/grids/filtering/grid-filtering-row.component.ts +++ b/projects/igniteui-angular/src/lib/grids/filtering/grid-filtering-row.component.ts @@ -61,6 +61,7 @@ export class IgxGridFilteringRowComponent implements AfterViewInit { private chipAreaScrollOffset = 0; private _column = null; private isKeyPressed = false; + private isComposing = false; public showArrows: boolean; public expression: IFilteringExpression; @@ -241,6 +242,10 @@ export class IgxGridFilteringRowComponent implements AfterViewInit { } if (event.key === KEYS.ENTER) { + if (this.isComposing) { + return; + } + this.chipsArea.chipsList.filter(chip => chip.selected = false); let indexToDeselect = -1; @@ -286,6 +291,20 @@ export class IgxGridFilteringRowComponent implements AfterViewInit { } } + /** + * Event handler for compositionstart on the input. + */ + public onCompositionStart() { + this.isComposing = true; + } + + /** + * Event handler for compositionend on the input. + */ + public onCompositionEnd() { + this.isComposing = false; + } + /** * Event handler for input click event. */