Skip to content

Commit

Permalink
Await the tree reload when the path changes in DirectoryTree
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenburns committed Oct 16, 2023
1 parent 710d6b5 commit 1a7feec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/textual/widgets/_directory_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,13 @@ def validate_path(self, path: str | Path) -> Path:
"""
return self.PATH(path)

def watch_path(self) -> None:
async def watch_path(self) -> None:
"""Watch for changes to the `path` of the directory tree.
If the path is changed the directory tree will be repopulated using
the new value as the root.
"""
self.reload()
await self.reload()

def process_label(self, label: TextType) -> Text:
"""Process a str or Text into a label. Maybe overridden in a subclass to modify how labels are rendered.
Expand Down

0 comments on commit 1a7feec

Please sign in to comment.