Skip to content

Support scrollIntoView alignment options #3952

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

otgerrogla
Copy link

Add support for options to the scroll_to method of RenderedElementBacking to define the desired final logical position inside the scrolling container for the vertical and horizontal axis. For the web platform this maps 1:1 to the options available in the corresponding DOM method scrollIntoView.

The current behavior is pretty limiting as it is only possible to scroll such that the element appears at the top of the scrolling container. Adding these options will add more flexibility, covering common use cases such as a list where when the last element fitting the scroll container is active, you want to just visually advance to the next element, instead of moving the next element to the top of the container.

@otgerrogla otgerrogla requested a review from a team as a code owner April 3, 2025 21:15
@ealmloff ealmloff added enhancement New feature or request breaking This is a breaking change html Related to the html crate labels Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This is a breaking change enhancement New feature or request html Related to the html crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants