You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pressing up/down to change the highlighted row in a Tree widget will scroll to strange x-offsets when node labels are wide.
For instance, render this Tree:
And then press the down key to highlight the first leaf of root:
Expected: Content scrolled so that "a" is the first visible character in the first leaf Observed: Content scrolled so that "c" is the first visible character in the first leaf
What is the significance of "2" in the above? Was this intended to ensure the down arrow is visible for non-leaf nodes? Or perhaps the DirectoryTree widget relies on this to show the file/folder icons?
Kind of an aside, but is there any case where the boolean value of show_root changes the result? Is the calculation not the same in either case?
Fix?
rcrowell@ec2207c seems to fix the off-by-two error in my testing. I may be missing something super obvious though, as this is my first weekend using textual...
Diagnostic
$ textual diagnose
<!-- This is valid Markdown, please paste the following directly in to a GitHub issue -->
# Textual Diagnostics
## Versions
| Name | Value |
|---------|--------|
| Textual | 0.71.0 |
| Rich | 13.7.1 |
## Python
| Name | Value |
|----------------|-------------------------------------------|
| Version | 3.10.4 |
| Implementation | CPython |
| Compiler | GCC 11.2.0 |
| Executable | /home/rcrowell/bemix/bemix-env/bin/python |
## Operating System
| Name | Value |
|---------|---------------------------------------------------------|
| System | Linux |
| Release | 6.5.11-8-pve |
| Version | #1 SMP PREEMPT_DYNAMIC PMX 6.5.11-8 (2024-01-30T12:27Z) |
## Terminal
| Name | Value |
|----------------------|----------------|
| Terminal Application | *Unknown* |
| TERM | xterm-256color |
| COLORTERM | *Not set* |
| FORCE_COLOR | *Not set* |
| NO_COLOR | *Not set* |
## Rich Console options
| Name | Value |
|----------------|---------------------|
| size | width=80, height=24 |
| legacy_windows | False |
| min_width | 1 |
| max_width | 80 |
| is_terminal | True |
| encoding | utf-8 |
| max_height | 24 |
| justify | None |
| overflow | None |
| no_wrap | False |
| highlight | None |
| markup | None |
| height | None |
The text was updated successfully, but these errors were encountered:
Have you checked closed issues? https://github.com/Textualize/textual/issues?q=is%3Aissue+is%3Aclosed
Description
Pressing up/down to change the highlighted row in a Tree widget will scroll to strange x-offsets when node labels are wide.
For instance, render this Tree:
And then press the down key to highlight the first leaf of root:
Expected: Content scrolled so that "a" is the first visible character in the first leaf
Observed: Content scrolled so that "c" is the first visible character in the first leaf
Here is my example app:
Possible Cause
This is the function in question:
Questions:
DirectoryTree
widget relies on this to show the file/folder icons?show_root
changes the result? Is the calculation not the same in either case?Fix?
rcrowell@ec2207c seems to fix the off-by-two error in my testing. I may be missing something super obvious though, as this is my first weekend using textual...
Diagnostic
The text was updated successfully, but these errors were encountered: