Skip to content

Commit cf7a5bc

Browse files
committed
fix(tree-base): if parent exists in cache
1 parent 685d3c7 commit cf7a5bc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: packages/tree-base/src/js/tree-base.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,6 @@
11251125
parentsCache.hasOwnProperty(row.uid)
11261126
) {
11271127
parents.push(parentsCache[row.uid]);
1128-
return
11291128
}
11301129

11311130
// aggregate if this is a leaf node
@@ -1134,13 +1133,15 @@
11341133
}
11351134

11361135
// add this node to the tree
1137-
service.addOrUseNode(grid, row, parents, aggregations);
1136+
if (!parentsCache.hasOwnProperty(row.uid)) {
1137+
service.addOrUseNode(grid, row, parents, aggregations);
1138+
}
11381139

11391140
if ( typeof(row.treeLevel) !== 'undefined' && row.treeLevel !== null && row.treeLevel >= 0 ) {
11401141
if (!parentsCache.hasOwnProperty(row.uid)) {
11411142
parentsCache[row.uid] = row;
1143+
parents.push(row);
11421144
}
1143-
parents.push(row);
11441145
currentLevel++;
11451146
currentState = service.setCurrentState(parents);
11461147
}

0 commit comments

Comments
 (0)