Skip to content

Commit 5c3d61b

Browse files
authored
Merge branch '18.2.x' into mtihova/bugfix-15136
2 parents a16a46c + 2bf1ed5 commit 5c3d61b

File tree

4 files changed

+118
-4
lines changed

4 files changed

+118
-4
lines changed

projects/igniteui-angular/src/lib/grids/filtering/excel-style/excel-style-filtering.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ export class IgxGridExcelStyleFilteringComponent extends BaseFilteringComponent
549549
const lowerCaseFilterValues = new Set(Array.from(expr.expression.searchVal).map((value: string) => value.toLowerCase()));
550550

551551
this.grid.data.forEach(item => {
552-
if (lowerCaseFilterValues.has(item[this.column.field]?.toLowerCase())) {
552+
if (typeof item[this.column.field] === "string" && lowerCaseFilterValues.has(item[this.column.field]?.toLowerCase())) {
553553
expr.expression.searchVal.add(item[this.column.field]);
554554
}
555555
});

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { GridFunctions } from '../../test-utils/grid-functions.spec';
1313
import { UIInteractions } from '../../test-utils/ui-interactions.spec';
1414
import { SampleTestData } from '../../test-utils/sample-test-data.spec';
1515
import { By } from '@angular/platform-browser';
16+
import { GridColumnDataType } from '../../data-operations/data-util';
1617

1718
const IGX_CHECKBOX_LABEL = '.igx-checkbox__label';
1819

@@ -751,6 +752,29 @@ describe('IgxTreeGrid - Filtering actions #tGrid', () => {
751752
emptyTextEl = searchComponent.querySelector('.igx-excel-filter__empty');
752753
expect(emptyTextEl.innerText).toEqual('No matches');
753754
}));
755+
756+
it('Should not throw console error when number column with dataType string is filtered.', fakeAsync(() => {
757+
tGrid.columns[0].dataType = GridColumnDataType.String;
758+
fix.detectChanges();
759+
spyOn(console, 'error');
760+
761+
GridFunctions.clickExcelFilterIcon(fix, 'ID');
762+
fix.detectChanges();
763+
tick();
764+
765+
const excelMenu = GridFunctions.getExcelStyleFilteringComponent(fix, 'igx-tree-grid');
766+
const checkboxes: any[] = Array.from(GridFunctions.getExcelStyleFilteringCheckboxes(fix, excelMenu, 'igx-tree-grid'));
767+
768+
checkboxes[2].click();
769+
tick();
770+
fix.detectChanges();
771+
772+
GridFunctions.clickApplyExcelStyleFiltering(fix, null, 'igx-tree-grid');
773+
fix.detectChanges();
774+
tick();
775+
776+
expect(console.error).not.toHaveBeenCalled();
777+
}));
754778
});
755779

756780
describe('Tree grid ESF templates', () => {

projects/igniteui-angular/src/lib/simple-combo/simple-combo.component.spec.ts

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,8 @@ describe('IgxSimpleCombo', () => {
11191119
IgxSimpleComboSampleComponent,
11201120
IgxComboInContainerTestComponent,
11211121
IgxSimpleComboIconTemplatesComponent,
1122-
IgxSimpleComboDirtyCheckTestComponent
1122+
IgxSimpleComboDirtyCheckTestComponent,
1123+
IgxSimpleComboTabBehaviorTestComponent
11231124
]
11241125
}).compileComponents();
11251126
}));
@@ -2113,6 +2114,35 @@ describe('IgxSimpleCombo', () => {
21132114

21142115
expect(reactiveForm.dirty).toBe(false);
21152116
}));
2117+
2118+
it('should focus on the next combo when Tab is pressed', fakeAsync(() => {
2119+
fixture = TestBed.createComponent(IgxSimpleComboTabBehaviorTestComponent);
2120+
fixture.detectChanges();
2121+
2122+
const combos = fixture.debugElement.queryAll(By.directive(IgxSimpleComboComponent));
2123+
expect(combos.length).toBe(3);
2124+
2125+
const firstComboInput = combos[0].query(By.css(`.${CSS_CLASS_COMBO_INPUTGROUP}`));
2126+
const secondComboInput = combos[1].query(By.css(`.${CSS_CLASS_COMBO_INPUTGROUP}`));
2127+
const thirdComboInput = combos[2].query(By.css(`.${CSS_CLASS_COMBO_INPUTGROUP}`));
2128+
2129+
firstComboInput.nativeElement.focus();
2130+
tick();
2131+
fixture.detectChanges();
2132+
expect(document.activeElement).toEqual(firstComboInput.nativeElement);
2133+
2134+
UIInteractions.triggerEventHandlerKeyDown('Tab', firstComboInput);
2135+
secondComboInput.nativeElement.focus();
2136+
tick();
2137+
fixture.detectChanges();
2138+
expect(document.activeElement).toEqual(secondComboInput.nativeElement);
2139+
2140+
UIInteractions.triggerEventHandlerKeyDown('Tab', secondComboInput);
2141+
thirdComboInput.nativeElement.focus();
2142+
tick();
2143+
fixture.detectChanges();
2144+
expect(document.activeElement).toEqual(thirdComboInput.nativeElement);
2145+
}));
21162146
});
21172147

21182148
describe('Display density', () => {
@@ -3456,3 +3486,64 @@ export class IgxSimpleComboDirtyCheckTestComponent implements OnInit {
34563486
];
34573487
}
34583488
}
3489+
3490+
@Component({
3491+
template: `
3492+
<form [formGroup]="form">
3493+
<div class="combo-section">
3494+
<igx-simple-combo
3495+
#combo
3496+
[data]="cities"
3497+
[displayKey]="'name'"
3498+
[valueKey]="'id'"
3499+
formControlName="city"
3500+
>
3501+
</igx-simple-combo>
3502+
3503+
<igx-simple-combo
3504+
#combo2
3505+
[data]="cities"
3506+
[displayKey]="'name'"
3507+
[valueKey]="'id'"
3508+
formControlName="city2"
3509+
></igx-simple-combo>
3510+
3511+
<igx-simple-combo
3512+
#combo3
3513+
[data]="cities"
3514+
[displayKey]="'name'"
3515+
[valueKey]="'id'"
3516+
formControlName="city3"
3517+
></igx-simple-combo>
3518+
</div>
3519+
</form>
3520+
`,
3521+
standalone: true,
3522+
imports: [IgxSimpleComboComponent, ReactiveFormsModule]
3523+
})
3524+
export class IgxSimpleComboTabBehaviorTestComponent implements OnInit {
3525+
@ViewChild('combo', { read: IgxSimpleComboComponent, static: true })
3526+
public combo: IgxSimpleComboComponent;
3527+
@ViewChild('combo2', { read: IgxSimpleComboComponent, static: true })
3528+
public combo2: IgxSimpleComboComponent;
3529+
@ViewChild('combo3', { read: IgxSimpleComboComponent, static: true })
3530+
public combo3: IgxSimpleComboComponent;
3531+
3532+
public cities = [];
3533+
3534+
public form = new FormGroup({
3535+
city: new FormControl<number>({ value: undefined, disabled: false }),
3536+
city2: new FormControl<number>({ value: undefined, disabled: false }),
3537+
city3: new FormControl<number>({ value: undefined, disabled: false }),
3538+
});
3539+
3540+
public ngOnInit(): void {
3541+
this.cities = [
3542+
{ id: 1, name: 'New York' },
3543+
{ id: 2, name: 'Los Angeles' },
3544+
{ id: 3, name: 'Chicago' },
3545+
{ id: 4, name: 'Houston' },
3546+
{ id: 5, name: 'Phoenix' }
3547+
];
3548+
}
3549+
}

projects/igniteui-angular/src/lib/simple-combo/simple-combo.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,8 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
466466
}
467467

468468
this.composing = false;
469-
// explicitly update selection and trigger text selection so that we don't have to force CD
469+
// explicitly update selection so that we don't have to force CD
470470
this.textSelection.selected = true;
471-
this.textSelection.trigger();
472471
}
473472

474473
/** @hidden @internal */

0 commit comments

Comments
 (0)