Skip to content
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

Select scroll is different with mouse vs keyboard #5356

Open
TomJGooding opened this issue Dec 6, 2024 · 2 comments
Open

Select scroll is different with mouse vs keyboard #5356

TomJGooding opened this issue Dec 6, 2024 · 2 comments

Comments

@TomJGooding
Copy link
Contributor

This is really only a minor issue that I noticed following the fix for #5255.

There's a strange difference in the scroll behaviour when the Select is expanded with the mouse vs the keyboard.

When expanded only with the keyboard, the initial value is always the bottom of the scroll.

When first expanded with the mouse, the the initial value is also the bottom of the scroll. However after a second click, the initial value is now the top of the scroll. Subsequent expands with either the mouse or keyboard will now scroll the selected value to the top.

from textual.app import App, ComposeResult
from textual.widgets import Select


class SelectApp(App):
    def compose(self) -> ComposeResult:
        yield Select.from_values(
            range(100),
            value=15,
        )


if __name__ == "__main__":
    app = SelectApp()
    app.run()
Copy link

github-actions bot commented Dec 6, 2024

We found the following entry in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

@TomJGooding
Copy link
Contributor Author

Shouldn't the selected option always scroll to the top?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant