Skip to content

Commit a948eb7

Browse files
committed
fix(grid): add check to remove first child, only when it is needed #5837
1 parent 679d086 commit a948eb7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

projects/igniteui-angular/src/lib/grids/column.component.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,10 +1795,12 @@ export class IgxColumnGroupComponent extends IgxColumnComponent implements After
17951795
});
17961796
this.children.changes.pipe(takeUntil(this.destroy$))
17971797
.subscribe(() => {
1798-
this.children.reset(this.children.toArray().slice(1));
1799-
this.children.forEach(child => {
1800-
child.parent = this;
1801-
});
1798+
if (this.children && this.children.toArray().length > 0 && this.children.toArray()[0] === this) {
1799+
this.children.reset(this.children.toArray().slice(1));
1800+
this.children.forEach(child => {
1801+
child.parent = this;
1802+
});
1803+
}
18021804
});
18031805
}
18041806

0 commit comments

Comments
 (0)