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

selectbox does not automatically scroll options into view when using spatial navigation #565

Open
Paril opened this issue Jan 6, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Paril
Copy link
Contributor

Paril commented Jan 6, 2024

When arrows are used to select options, it will select options outside of the purview of the scroll area. I managed to 'patch' this with an event handler on change and using the following:

select->GetOption(select->GetSelection())->ScrollIntoView(Rml::ScrollIntoViewOptions { Rml::ScrollAlignment::Nearest, Rml::ScrollAlignment::Nearest });

this seems to do what you'd expect, where it always keeps the selected option visible but does not snap it to the top or bottom as you scroll. Not sure if this should just be shoved back into the main element code or if I'm maybe missing something.

It also makes me wonder if I'm going to run into the same issue when using a generic scrollable area with navigable elements inside of it, but I'll handle that as it comes up :)

EDIT: it also does not scroll the selected option into view automatically. still working on that one

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

No branches or pull requests

2 participants