Merge pull request #2473 from davep/fix-dir-tree-eager-path

This commit is contained in:
Dave Pearson
2023-05-03 22:34:39 +01:00
committed by GitHub
2 changed files with 5 additions and 1 deletions

View File

@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## Unreleased ## Unreleased
### Fixed
- Fixed crash when creating a `DirectoryTree` starting anywhere other than `.`
### Changed ### Changed
- The DataTable cursor is now scrolled into view when the cursor coordinate is changed programmatically https://github.com/Textualize/textual/issues/2459 - The DataTable cursor is now scrolled into view when the cursor coordinate is changed programmatically https://github.com/Textualize/textual/issues/2459

View File

@@ -103,7 +103,6 @@ class DirectoryTree(Tree[DirEntry]):
classes: A space-separated list of classes, or None for no classes. classes: A space-separated list of classes, or None for no classes.
disabled: Whether the directory tree is disabled or not. disabled: Whether the directory tree is disabled or not.
""" """
self.path = path
super().__init__( super().__init__(
str(path), str(path),
data=DirEntry(Path(path)), data=DirEntry(Path(path)),
@@ -112,6 +111,7 @@ class DirectoryTree(Tree[DirEntry]):
classes=classes, classes=classes,
disabled=disabled, disabled=disabled,
) )
self.path = path
def reload(self) -> None: def reload(self) -> None:
"""Reload the `DirectoryTree` contents.""" """Reload the `DirectoryTree` contents."""