Skip to content

Commit f800a30

Browse files
author
mmart1n
committed
fix(tree-grid): update selection state correctly when grid is filtered
- with primaryKey - foreignKey configuration
1 parent 400ba57 commit f800a30

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

projects/igniteui-angular/src/lib/grids/tree-grid/tree-grid.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ export class IgxTreeGridComponent extends IgxGridBaseDirective implements GridTy
478478
// if a row has been added and before commiting the transaction deleted
479479
const leafRowsDirectParents = new Set<any>();
480480
this.records.forEach(record => {
481-
if (record && !record.children && record.parent) {
481+
if (record && (!record.children || record.children.length === 0) && record.parent) {
482482
leafRowsDirectParents.add(record.parent);
483483
}
484484
});
@@ -495,7 +495,7 @@ export class IgxTreeGridComponent extends IgxGridBaseDirective implements GridTy
495495
if (this.rowSelection === GridSelectionMode.multipleCascade) {
496496
const leafRowsDirectParents = new Set<any>();
497497
this.records.forEach(record => {
498-
if (record && !record.children && record.parent) {
498+
if (record && (!record.children || record.children.length === 0) && record.parent) {
499499
leafRowsDirectParents.add(record.parent);
500500
}
501501
});

0 commit comments

Comments
 (0)