diff --git a/src/textual/widgets/_directory_tree.py b/src/textual/widgets/_directory_tree.py index e6b81abee..c0bb2c505 100644 --- a/src/textual/widgets/_directory_tree.py +++ b/src/textual/widgets/_directory_tree.py @@ -271,6 +271,7 @@ class DirectoryTree(Tree[DirEntry]): node: The Tree node to populate. content: The collection of `Path` objects to populate the node with. """ + node.remove_children() for path in content: node.add( path.name,