Skip to content

Commit c008fd5

Browse files
authored
Merge pull request #9403 from IgniteUI/astaev/issue9333-10.2.x
Astaev/issue9333 10.2.x
2 parents be244a8 + f9767a7 commit c008fd5

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ export class IgxGridFilteringRowComponent implements AfterViewInit {
446446
requestAnimationFrame(() => {
447447
const focusedElement = document.activeElement;
448448

449-
if (focusedElement.className === 'igx-chip__remove' || focusedElement.tagName === 'IGX-DAY-ITEM') {
449+
if (focusedElement.classList.contains('igx-chip__remove') || focusedElement.tagName === 'IGX-DAY-ITEM') {
450450
return;
451451
}
452452

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import {
4747
import { GridSelectionMode, FilterMode } from '../common/enums';
4848
import { ControlsFunction } from '../../test-utils/controls-functions.spec';
4949
import localeFR from '@angular/common/locales/fr';
50+
import { IgxInputGroupComponent } from '../../input-group/public_api';
5051

5152
const DEBOUNCETIME = 30;
5253
const FILTER_UI_ROW = 'igx-grid-filtering-row';
@@ -2116,6 +2117,28 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
21162117
// Verify filtered data
21172118
expect(grid.filteredData).toBeNull();
21182119
}));
2120+
2121+
it('Should remove pending chip via its close button #9333', fakeAsync(() => {
2122+
GridFunctions.clickFilterCellChipUI(fix, 'Downloads');
2123+
fix.detectChanges();
2124+
2125+
GridFunctions.typeValueInFilterRowInput('3', fix);
2126+
tick(DEBOUNCETIME);
2127+
const inputGroup = fix.debugElement.query(By.directive(IgxInputGroupComponent));
2128+
const filterRow = fix.debugElement.query(By.directive(IgxGridFilteringRowComponent));
2129+
const pendingChip = filterRow.queryAll(By.directive(IgxChipComponent))[0];
2130+
const chipCloseButton = pendingChip.query(By.css('div.igx-chip__remove')).nativeElement;
2131+
2132+
chipCloseButton.dispatchEvent(new Event('mousedown'));
2133+
inputGroup.nativeElement.dispatchEvent(new Event('focusout'));
2134+
chipCloseButton.dispatchEvent(new Event('mouseup'));
2135+
chipCloseButton.dispatchEvent(new Event('click'));
2136+
tick(DEBOUNCETIME);
2137+
fix.detectChanges();
2138+
2139+
const chips = filterRow.queryAll(By.directive(IgxChipComponent));
2140+
expect(chips.length).toEqual(0, 'No chips should be present');
2141+
}));
21192142
});
21202143

21212144
describe('Integration scenarios', () => {

0 commit comments

Comments
 (0)