Skip to content

Commit 5425c65

Browse files
authored
Merge pull request #10490 from IgniteUI/rkaraivanov/fix-10489
fix(grid): Groupby stack error on a single group
2 parents a8f6555 + 4650887 commit 5425c65

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

projects/igniteui-angular/src/lib/data-operations/sorting-strategy.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,20 @@ export class IgxSorting implements IGridSortingStrategy {
150150
fullResult.data.push(groupItem);
151151
}
152152
if (expanded) {
153-
metadata.push(...fullResult.metadata.slice(fullResult.metadata.length - group.length));
154-
result.push(...fullResult.data.slice(fullResult.data.length - group.length));
153+
// Replaced object destructing as in a single big group scenario
154+
// it hits the max number of arguments for a function the underlying JS engine
155+
// supports.
156+
let j = fullResult.metadata.length - group.length;
157+
158+
for (; j < fullResult.metadata.length; j++) {
159+
metadata.push(fullResult.metadata[j]);
160+
}
161+
162+
j = fullResult.data.length - group.length;
163+
164+
for (; j < fullResult.data.length; j++) {
165+
result.push(fullResult.data[j]);
166+
}
155167
}
156168
}
157169
i += group.length;

0 commit comments

Comments
 (0)