Skip to content

Commit 921dae1

Browse files
authored
Merge branch '9.1.x' into skrastev/fix-7469-9.1.x
2 parents 0aa854e + 985d8d1 commit 921dae1

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

projects/igniteui-angular/src/lib/grids/grid/grid-api.service.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,16 @@ export class IgxGridAPIService extends GridBaseAPIService<IgxGridComponent> {
4343
names.forEach((colName) => {
4444
const grExprIndex = groupingState.findIndex((exp) => exp.fieldName === colName);
4545
const grpExpandState = this.grid.groupingExpansionState;
46-
/* remove expansion states related to the cleared group
47-
and all with deeper hierarchy than the cleared group */
48-
this.grid.groupingExpansionState = grpExpandState
49-
.filter((val) => {
50-
return val.hierarchy && val.hierarchy.length <= grExprIndex;
51-
});
46+
/* remove expansion states related to the cleared group
47+
and all with deeper hierarchy than the cleared group */
48+
const newExpandState = grpExpandState.filter((val) => {
49+
return val.hierarchy && val.hierarchy.length <= grExprIndex;
50+
});
51+
/* Do not set the new instance produced by filter
52+
when there are no differences between expansion states */
53+
if (newExpandState.length !== grpExpandState.length) {
54+
this.grid.groupingExpansionState = newExpandState;
55+
}
5256
});
5357
} else {
5458
// clear all

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,6 +1684,7 @@ describe('IgxGrid - Summaries #grid', () => {
16841684
GridSummaryFunctions.verifyColumnSummaries(summaryRow, 4, ['Count', 'Min', 'Max', 'Sum', 'Avg'], ['2', '31', '43', '74', '37']);
16851685

16861686
grid.clearGrouping('OnPTO');
1687+
fix.detectChanges();
16871688
verifyBaseSummaries(fix);
16881689
verifySummariesForParentID17(fix, 3);
16891690
verifySummariesForParentID19(fix, 6);

0 commit comments

Comments
 (0)