Skip to content

Commit 5c1ac5d

Browse files
authored
Merge pull request #10241 from IgniteUI/dTsvetkov/fix-9782-master
fix(hierarchical-grid): add correct check for row and expansion indexes
2 parents da16344 + 092f594 commit 5c1ac5d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

projects/igniteui-angular/src/lib/grids/grid-base.directive.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6881,16 +6881,21 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
68816881
const activeEl = this.selectionService.activeElement;
68826882

68836883
if (this.nativeElement.tagName.toLowerCase() === 'igx-hierarchical-grid') {
6884-
const expansionRowIndexes = Array.from(this.expansionStates.keys());
6884+
const expansionRowIndexes = [];
6885+
for (const [key, value] of this.expansionStates.entries()) {
6886+
if (value) {
6887+
expansionRowIndexes.push(key);
6888+
}
6889+
}
68856890
if (this.selectionService.selection.size > 0) {
68866891
if (expansionRowIndexes.length > 0) {
68876892
for (const [key, value] of this.selectionService.selection.entries()) {
68886893
let updatedKey = key;
68896894
expansionRowIndexes.forEach(row => {
68906895
let rowIndex;
6891-
if (row.ID) {
6896+
if (!isNaN(row.ID)) {
68926897
rowIndex = Number(row.ID);
6893-
}else {
6898+
} else {
68946899
rowIndex = Number(row);
68956900
}
68966901

0 commit comments

Comments
 (0)