mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Merge pull request #2473 from davep/fix-dir-tree-eager-path
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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."""
|
||||||
|
|||||||
Reference in New Issue
Block a user