Skip to content

Commit d41acc0

Browse files
committed
fix(staticTreeSource): fix a bug with trail() for nodes without children
1 parent a002928 commit d41acc0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/static-tree-source.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class StaticTreeSource<T> implements TreeSource<T> {
2222
if (parentId !== null) {
2323
this.childrenData[parentId].push(child);
2424
}
25+
const childTrail = [child, ...trail];
26+
this.trailsData[child.id] = childTrail;
2527
if (child.children) {
26-
const childTrail = [child, ...trail];
27-
this.trailsData[child.id] = childTrail;
2828
walkTree(child.children, childTrail);
2929
}
3030
}

0 commit comments

Comments
 (0)