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 selected item into view #656

Closed
jvolker opened this issue Sep 9, 2024 · 1 comment · May be fixed by #469
Closed

Select: scroll selected item into view #656

jvolker opened this issue Sep 9, 2024 · 1 comment · May be fixed by #469
Labels
Svelte 5 Roadmap This issue is planned to be addressed or fixed when the library migrates to Svelte 5.

Comments

@jvolker
Copy link

jvolker commented Sep 9, 2024

Describe the feature in detail (code, mocks, or screenshots encouraged)

Currently, when using a Select element with many items, the list always displays starting from the first element, requiring users to scroll to see the selected item. It would be beneficial if the list scrolled automatically to bring the selected item into view when the dropdown is opened. This would make it easier to see the current selection and avoid unnecessary scrolling. Additionally, in an ordered list, users are likely to be interested in items near the selected one.

Use Case: Consider a form with three Select elements for entering a birthdate (day, month, year). If the "year" dropdown is set to 1980, but the list starts with 2024, users have to scroll a significant distance to adjust the year from 1980 to 1981. It would be useful to have the list automatically scroll to the currently selected item. Furthermore, if no item is selected, it would be helpful to set a default scroll position based on a commonly used range (e.g., around the year 1980).

I couldn't find an existing feature that addresses this, but I might have missed it. Thank you for considering this improvement!

What type of pull request would this be?

Enhancement

Provide relevant links or additional information.

No response

@huntabyte huntabyte mentioned this issue Sep 18, 2024
4 tasks
@huntabyte huntabyte added the Svelte 5 Roadmap This issue is planned to be addressed or fixed when the library migrates to Svelte 5. label Sep 19, 2024
@huntabyte
Copy link
Owner

Closing as fixed in bits-ui@next

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Svelte 5 Roadmap This issue is planned to be addressed or fixed when the library migrates to Svelte 5.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants