-
Notifications
You must be signed in to change notification settings - Fork 815
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
The widget single cell scrolling methods no longer work as expected from the keyboard #1897
Comments
davep
added a commit
to davep/textual-sandbox
that referenced
this issue
Feb 28, 2023
I think we need to differentiate between mouse scroll (which should respect sensitivity and keyboard scroll which should not respect sensitivity). Suspect we will need to add a "mouse_initiated" bool to the scroll up / down / left / right methods. |
davep
added a commit
to davep/textual
that referenced
this issue
Feb 28, 2023
The changes here roll two issues into one change. With this commit: - Scrolling up/down/etc using the keyboard now moves just one cell, rather than moving the number of cells specified by the scroll sensitivity that's intended for pointing devices. Textualize#1897 - Where appropriate the scrolling is done lazily; that is it is done after the next refresh, helping to ensure that the scroll will take into account any updates in the same parent call. Textualize#1774
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
Consider the following (slightly over-complicated, but designed to show all the related information) code:
If you run it and, using just the keyboard, try and scroll down just one line, or up one line, you'll find it's not possible. It will always scroll two lines.
It seems that this was introduced as part of #1689 ("Scroll sensitivity"). Two
App
-level properties were introduced, calledscroll_sensitivity_x
andscroll_sensitivity_y
. Both properties say they dictate the number of cells to scroll in the given direction "with wheel or trackpad". However, they're used in the relatedWidget.scroll_*
methods regardless of the input method.At the very least
scroll_up
,scroll_down
,scroll_left
andscroll_right
should be modified to only apply the sensitivity setting if the input device is a pointing device rather than a key binding.The text was updated successfully, but these errors were encountered: