Skip to content

Commit e41ae89

Browse files
authored
Revert "fix(filtering): Avoid resetting values for number inputs #6973"
1 parent 26b0747 commit e41ae89

File tree

2 files changed

+9
-32
lines changed

2 files changed

+9
-32
lines changed

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { IBaseChipEventArgs, IgxChipsAreaComponent, IgxChipComponent } from '../
2424
import { ExpressionUI } from './grid-filtering.service';
2525
import { IgxDropDownItemComponent } from '../../drop-down/drop-down-item.component';
2626
import { IgxFilteringService } from './grid-filtering.service';
27-
import { KEYS, isEdge, isIE } from '../../core/utils';
27+
import { KEYS, isEdge } from '../../core/utils';
2828
import { AbsoluteScrollStrategy } from '../../services/overlay/scroll';
2929

3030
/**
@@ -281,11 +281,8 @@ export class IgxGridFilteringRowComponent implements AfterViewInit {
281281
public onInput(eventArgs) {
282282
// The 'iskeyPressed' flag is needed for a case in IE, because the input event is fired on focus and for some reason,
283283
// when you have a japanese character as a placeholder, on init the value here is empty string .
284-
// There is no need to reset the value on every invalid number input.
285-
// The invalid value is converted to empty string input type="number"
286-
const target = eventArgs.target;
287-
if (isEdge() && target.type !== 'number' || this.isKeyPressed && isIE() || target.value) {
288-
this.value = target.value;
284+
if (isEdge() || this.isKeyPressed || eventArgs.target.value) {
285+
this.value = eventArgs.target.value;
289286
}
290287
}
291288

projects/igniteui-angular/src/lib/grids/grid/grid-filtering-ui.spec.ts

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import {
4646
import { HelperUtils } from '../../test-utils/helper-utils.spec';
4747
import { GridSelectionMode, FilterMode } from '../common/enums';
4848

49-
const DEBOUNCETIME = 30;
5049
const FILTER_UI_ROW = 'igx-grid-filtering-row';
5150
const FILTER_UI_CELL = 'igx-grid-filtering-cell';
5251
const FILTER_UI_SCROLL_START_CLASS = '.igx-grid__filtering-row-scroll-start';
@@ -669,25 +668,6 @@ describe('IgxGrid - Filtering actions #grid', () => {
669668
tick(100);
670669
fix.detectChanges();
671670

672-
sendInput(input, '254..', fix);
673-
tick();
674-
fix.detectChanges();
675-
676-
677-
expect(grid.rowList.length).toEqual(6);
678-
expect(close.nativeElement.classList.contains('igx-button--disabled')).toBeFalsy();
679-
expect(reset.nativeElement.classList.contains('igx-button--disabled')).toBeFalsy();
680-
expect(input.nativeElement.offsetHeight).toBeGreaterThan(0);
681-
682-
// open dropdown
683-
filterIcon.nativeElement.click();
684-
tick();
685-
fix.detectChanges();
686-
// less than or equal to
687-
ddItems[5].click();
688-
tick(100);
689-
fix.detectChanges();
690-
691671
expect(grid.rowList.length).toEqual(6);
692672
expect(close.nativeElement.classList.contains('igx-button--disabled')).toBeFalsy();
693673
expect(reset.nativeElement.classList.contains('igx-button--disabled')).toBeFalsy();
@@ -2865,9 +2845,9 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
28652845
expect(GridFunctions.getCurrentCellFromGrid(grid, 1, 1).value).toBe('Ignite UI for Angular');
28662846
}));
28672847

2868-
it('Verify filter cell chip is scrolled into view on click.', async () => {
2848+
it('Verify filter cell chip is scrolled into view on click.', fakeAsync(() => {
28692849
grid.width = '470px';
2870-
await wait(DEBOUNCETIME);
2850+
tick(100);
28712851
fix.detectChanges();
28722852

28732853
// Verify 'ReleaseDate' filter chip is not fully visible.
@@ -2878,11 +2858,11 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
28782858
'chip should not be fully visible and thus not within grid');
28792859

28802860
GridFunctions.clickFilterCellChip(fix, 'ReleaseDate');
2881-
await wait(DEBOUNCETIME);
2861+
tick(100);
28822862
fix.detectChanges();
28832863

2884-
grid.filteringRow.close();
2885-
await wait();
2864+
GridFunctions.closeFilterRow(fix);
2865+
tick(100);
28862866
fix.detectChanges();
28872867

28882868
// Verify 'ReleaseDate' filter chip is fully visible.
@@ -2891,7 +2871,7 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
28912871
gridRect = grid.nativeElement.getBoundingClientRect();
28922872
expect(chipRect.left > gridRect.left && chipRect.right < gridRect.right).toBe(true,
28932873
'chip should be fully visible and within grid');
2894-
});
2874+
}));
28952875

28962876
it('Verify condition chips are scrolled into/(out of) view by using arrow buttons.', (async () => {
28972877
grid.width = '700px';

0 commit comments

Comments
 (0)