Skip to content

Add scrollIntoView() container option #40588

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

Merged
merged 5 commits into from
Aug 5, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add experimental icon
  • Loading branch information
aguingand committed Aug 1, 2025
commit 8cd26e0d0f4c8620613f193c395a2950a188fcea
2 changes: 1 addition & 1 deletion files/en-us/web/api/element/scrollintoview/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ scrollIntoView(scrollIntoViewOptions)
- `end`: Aligns the element's right edge with the right of the scrollable container, placing the element at the end of the visible area horizontally.
- `nearest`: Scrolls the element to the nearest edge in the horizontal direction. If the element is closer to the left edge of the scrollable container, it will align to the left; if it's closer to the right edge, it will align to the right. This minimizes the scrolling distance.
- Defaults to `nearest`.
- `container` {{optional_inline}}
- `container` {{optional_inline}} {{experimental_inline}}
- : Defines the scrollable ancestor container. This option is a string and accepts one of the following values:
- `all`: All scrollable containers will be impacted (including the viewport).
- `nearest`: Only the nearest scrollable container will be impacted by the scroll.
Expand Down