Skip to content

Commit 1ac097e

Browse files
committed
fix(filtering): Fix error when delete last filter chip #5304
1 parent c1d821a commit 1ac097e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,12 +748,13 @@ export class IgxGridFilteringRowComponent implements AfterViewInit {
748748
}
749749

750750
private scrollChipsOnRemove() {
751-
let count = -1;
751+
let count = 0;
752752
const chipAraeChildren = this.chipsArea.element.nativeElement.children;
753753
const containerRect = this.container.nativeElement.getBoundingClientRect();
754754

755755
for (let index = 0; index < chipAraeChildren.length; index++) {
756-
if (Math.ceil(chipAraeChildren[index].getBoundingClientRect().left) < Math.ceil(containerRect.left)) {
756+
if (Math.ceil(chipAraeChildren[index].getBoundingClientRect().left) < Math.ceil(containerRect.left) &&
757+
Math.ceil(chipAraeChildren[index].getBoundingClientRect().right) < Math.ceil(containerRect.left)) {
757758
count++;
758759
}
759760
}

0 commit comments

Comments
 (0)