Skip to content

Commit 9d85f70

Browse files
authored
Merge branch '8.2.x' into mdragnev/fix-6058-8.2.x
2 parents ba4de81 + 0b2de14 commit 9d85f70

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1870,7 +1870,7 @@ export class IgxColumnGroupComponent extends IgxColumnComponent implements After
18701870
*/
18711871
this.children.changes.pipe(takeUntil(this.destroy$))
18721872
.subscribe((change) => {
1873-
if (change.length > 1 && change.first === this) {
1873+
if (change.first === this) {
18741874
this.children.reset(this.children.toArray().slice(1));
18751875
this.children.forEach(child => {
18761876
child.parent = this;

projects/igniteui-angular/src/lib/grids/grid/column-group.spec.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,21 +1570,29 @@ describe('IgxGrid - multi-column headers #grid', () => {
15701570

15711571
expect(grid.columnList.length).toEqual(9);
15721572

1573+
expect(() => {
1574+
// Delete all column
1575+
fixture.componentInstance.columnGroups[0].columns.splice(0, 2);
1576+
fixture.detectChanges();
1577+
}).not.toThrow();
1578+
1579+
expect(grid.columnList.length).toEqual(7);
1580+
15731581
expect(() => {
15741582
// Add column
15751583
fixture.componentInstance.columnGroups[0].columns.push({ field: 'Fax', type: 'string' });
15761584
fixture.detectChanges();
15771585
}).not.toThrow();
15781586

1579-
expect(grid.columnList.length).toEqual(10);
1587+
expect(grid.columnList.length).toEqual(8);
15801588

15811589
expect(() => {
15821590
// Update column
1583-
fixture.componentInstance.columnGroups[0].columns[1] = { field: 'City', type: 'string' };
1591+
fixture.componentInstance.columnGroups[0].columns[0] = { field: 'City', type: 'string' };
15841592
fixture.detectChanges();
15851593
}).not.toThrow();
15861594

1587-
expect(grid.columnList.length).toEqual(10);
1595+
expect(grid.columnList.length).toEqual(8);
15881596
});
15891597
});
15901598

@@ -1965,15 +1973,15 @@ export class DynamicColGroupsGridComponent {
19651973
{ columnHeader: 'First', columns: [
19661974
{ field: 'ID', type: 'string' },
19671975
{ field: 'CompanyName', type: 'string' },
1968-
{ field: 'ContactName', type: 'string' },
1976+
{ field: 'ContactName', type: 'string' }
19691977
]},
19701978
{ columnHeader: 'Second', columns: [
19711979
{ field: 'ContactTitle', type: 'string' },
1972-
{ field: 'Address', type: 'string' },
1980+
{ field: 'Address', type: 'string' }
19731981
]},
19741982
{ columnHeader: 'Third', columns: [
19751983
{ field: 'PostlCode', type: 'string' },
1976-
{ field: 'Contry', type: 'string' },
1984+
{ field: 'Contry', type: 'string' }
19771985
]},
19781986
];
19791987
}

0 commit comments

Comments
 (0)