Skip to content

Commit

Permalink
Process the label on construction of a TreeNode
Browse files Browse the repository at this point in the history
Currently there's an asymmetry in how the label is handled for a TreeNode.
If a str label is passed to the constructor it stays as a str type. On the
other hand, if it's set via set_label, it gets processed into a Rich Text
type. This commit removes that asymmetry.
  • Loading branch information
davep committed Jan 5, 2023
1 parent aaad1a3 commit a1e63a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/textual/widgets/_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def __init__(
self._tree = tree
self._parent = parent
self._id = id
self._label = label
self._label = tree.process_label(label)
self.data = data
self._expanded = expanded
self._children: list[TreeNode] = []
Expand Down

0 comments on commit a1e63a1

Please sign in to comment.