diff --git a/tree.go b/tree.go index 2e7cae2..ed4c443 100644 --- a/tree.go +++ b/tree.go @@ -50,7 +50,7 @@ func (tree *TreeWidget) Draw(buffer *termui.Buffer) { func (tree *TreeWidget) AddRootNode(node *Node) { tree.rootNodes = append(tree.rootNodes, node) if len(tree.rootNodes) == 1 { - tree.selectedNode = node.children[0] + tree.selectedNode = node } node.setTree(tree) }