-
Notifications
You must be signed in to change notification settings - Fork 844
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
Add index to Tree widget's add #4049
Comments
Would that cover all use-cases? What if you want to insert before another item, or at the start. The |
@willmcgugan it would, but the caller would be responsible for figuring out the index. |
This would be useful 👍 When adding a new node at a level of the tree that contains many siblings, it can be really jarring having it appear right at the bottom (and causing scrolling to occur). |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
Presently there is no way to add a new tree node except as the last node, accordingly:
Would you accept an optional
index
here?textual/src/textual/widgets/_tree.py
Lines 320 to 327 in ce96219
If set it would change this from
append
toinsert
and passindex
:textual/src/textual/widgets/_tree.py
Line 344 in ce96219
The text was updated successfully, but these errors were encountered: