Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DirectoryTree.clear_node doesn't actually clear the node #4122

Closed
rodrigogiraoserrao opened this issue Feb 5, 2024 · 1 comment · Fixed by #4123
Closed

DirectoryTree.clear_node doesn't actually clear the node #4122

rodrigogiraoserrao opened this issue Feb 5, 2024 · 1 comment · Fixed by #4123
Labels
bug Something isn't working

Comments

@rodrigogiraoserrao
Copy link
Contributor

The current implementation of DirectoryTree.clear_node assigns to node but then does nothing with it, which means it doesn't really clear the node passed in:

def clear_node(self, node: TreeNode[DirEntry]) -> Self:
"""Clear all nodes under the given node.
Returns:
The `Tree` instance.
"""
self._clear_line_cache()
node_label = node._label
node_data = node.data
node_parent = node.parent
node = TreeNode(
self,
node_parent,
self._new_id(),
node_label,
node_data,
expanded=True,
)
self._updates += 1
self.refresh()
return self

Copy link

github-actions bot commented Feb 7, 2024

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant