From abf1b175ef8c96b1b297e68639c978964506a4f9 Mon Sep 17 00:00:00 2001 From: Stamen Stoychev Date: Tue, 21 Apr 2020 13:23:18 +0300 Subject: [PATCH] Revert "fix(filtering): Avoid resetting values for number inputs #6973" --- .../grids/filtering/base/grid-filtering-row.component.ts | 9 +++------ .../src/lib/grids/grid/grid-filtering-ui.spec.ts | 7 ------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/projects/igniteui-angular/src/lib/grids/filtering/base/grid-filtering-row.component.ts b/projects/igniteui-angular/src/lib/grids/filtering/base/grid-filtering-row.component.ts index 90823ba3b10..3cddddbd85a 100644 --- a/projects/igniteui-angular/src/lib/grids/filtering/base/grid-filtering-row.component.ts +++ b/projects/igniteui-angular/src/lib/grids/filtering/base/grid-filtering-row.component.ts @@ -24,7 +24,7 @@ import { IBaseChipEventArgs, IgxChipsAreaComponent, IgxChipComponent } from '../ import { ExpressionUI } from '../grid-filtering.service'; import { IgxDropDownItemComponent } from '../../../drop-down/drop-down-item.component'; import { IgxFilteringService } from '../grid-filtering.service'; -import { KEYS, isEdge, isIE } from '../../../core/utils'; +import { KEYS, isEdge } from '../../../core/utils'; import { AbsoluteScrollStrategy } from '../../../services/overlay/scroll'; /** @@ -262,11 +262,8 @@ export class IgxGridFilteringRowComponent implements AfterViewInit { public onInput(eventArgs) { // The 'iskeyPressed' flag is needed for a case in IE, because the input event is fired on focus and for some reason, // when you have a japanese character as a placeholder, on init the value here is empty string . - // There is no need to reset the value on every invalid number input. - // The invalid value is converted to empty string input type="number" - const target = eventArgs.target; - if (isEdge() && target.type !== 'number' || this.isKeyPressed && isIE() || target.value) { - this.value = target.value; + if (isEdge() || this.isKeyPressed || eventArgs.target.value) { + this.value = eventArgs.target.value; } } diff --git a/projects/igniteui-angular/src/lib/grids/grid/grid-filtering-ui.spec.ts b/projects/igniteui-angular/src/lib/grids/grid/grid-filtering-ui.spec.ts index cc6fec763b1..da997b2413f 100644 --- a/projects/igniteui-angular/src/lib/grids/grid/grid-filtering-ui.spec.ts +++ b/projects/igniteui-angular/src/lib/grids/grid/grid-filtering-ui.spec.ts @@ -229,13 +229,6 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => { expect(grid.rowList.length).toEqual(3); verifyFilterRowUI(input, close, reset, false); - - // greater than or equal to with invalid value should not reset filter - GridFunctions.openFilterDDAndSelectCondition(fix, 4); - GridFunctions.typeValueInFilterRowInput('254..', fix, input); - - expect(grid.rowList.length).toEqual(3); - verifyFilterRowUI(input, close, reset, false); })); // UI tests boolean column