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

Scrolling in long OptionList doesn't accompany keyboard navigation by default #4021

Closed
rodrigogiraoserrao opened this issue Jan 15, 2024 · 5 comments · Fixed by #4100
Closed
Labels
enhancement New feature or request Task

Comments

@rodrigogiraoserrao
Copy link
Contributor

If you use the keyboard to navigate inside an OptionList and if you move past the visible options, there is no scrolling to accompany your movement (there should).

Screen.Recording.2024-01-15.at.11.46.10.mov
App shown in video
from textual.app import App, ComposeResult
from textual.widgets import OptionList
from textual.widgets.option_list import Option


class ListApp(App[None]):
    def compose(self) -> ComposeResult:
        yield OptionList(*[Option(f"This is option #{n}") for n in range(100)])


if __name__ == "__main__":
    ListApp().run()
@rodrigogiraoserrao rodrigogiraoserrao added bug Something isn't working Task labels Jan 15, 2024
@davep
Copy link
Contributor

davep commented Jan 15, 2024

What's the height for this example?

@davep
Copy link
Contributor

davep commented Jan 15, 2024

Perhaps Why doesn't the DataTable scroll programmatically? needs expanding a wee bit?

@rodrigogiraoserrao
Copy link
Contributor Author

🤦
Maybe OptionList should come with a max-height: 100% by default?

@rodrigogiraoserrao rodrigogiraoserrao added enhancement New feature or request and removed bug Something isn't working labels Jan 15, 2024
@rodrigogiraoserrao rodrigogiraoserrao changed the title Scrolling in OptionList doesn't accompany keyboard navigation Scrolling in long OptionList doesn't accompany keyboard navigation by default Jan 15, 2024
@TomJGooding
Copy link
Contributor

Maybe OptionList should come with a max-height: 100% by default?

I thought this fix was simple enough that I could try to help, until I remembered that OptionList has padding/border.

This might need a fix for percentage dimensions (#4037 or #4023) to land first.

Copy link

github-actions bot commented Feb 7, 2024

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
Labels
enhancement New feature or request Task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants