diff --git a/src/utils/VisibleNodesGenerator.ts b/src/utils/VisibleNodesGenerator.ts index 48a2516..c4250a7 100644 --- a/src/utils/VisibleNodesGenerator.ts +++ b/src/utils/VisibleNodesGenerator.ts @@ -254,7 +254,10 @@ class FlattenLayer extends CompressLayer { barelySetExpand = (node: TreeNode, expand: boolean) => { if (expand) { - this.expandedNodes.add(node.path) + if (node.type === 'tree') { + // expanding non-tree node could cause unexpected UX + this.expandedNodes.add(node.path) + } } else { this.expandedNodes.delete(node.path) }