-
Notifications
You must be signed in to change notification settings - Fork 814
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
Scrolling cursor into view on DataTable fails, even though it was fixed #2543
Comments
Ah setting the height as follows helped: |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
@href Glad you solved it. The scrollbar you were seeing wasn't the scrollbar of the DataTable itself, it was the scrollbar of the widget containing the DataTable. Both configurations look the exact same, so it's difficult to spot. |
Just as an aside, you could also create a custom datatable to save handling the keys bindngs within the app itself. I've done this with many of my personal Textual projects. class ViLikeDataTable(DataTable):
BINDINGS = [
("j", "cursor_down", "Down"),
("k", "cursor_up", "Up"),
]
def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs) |
Thanks everyone, this is super helpful and a great onboarding experience! |
@TomJGooding An aside to your aside; you could simplify that by dropping the |
With #2459 the selected row of a DataTable should scroll into view when changing the coordinates, but I am unable to get this to work.
In the following example, I move the cursor using
j
andk
, given a sufficiently small viewport (you should see the scrollbar on the right). As you can see, the cursor vanishes at the bottom.The code I use is the following:
I am a beginner, so maybe I'm doing something wrong 😅
Textual Diagnostics
Versions
Python
Operating System
Terminal
Rich Console options
The text was updated successfully, but these errors were encountered: