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
Apply suggestions from code review
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
Josh-Cena and github-actions[bot] authored Aug 1, 2025
commit 931eac4b8204f196cc85bc74f80cb01bf7b2df47
4 changes: 0 additions & 4 deletions files/en-us/web/api/element/scrollintoview/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ scrollIntoView(options)
- : An object with the following properties:
- `behavior` {{optional_inline}}
- : Determines whether scrolling is instant or animates smoothly. Its value can be one of the following:

- `"smooth"`: scrolling should animate smoothly
- `"instant"`: scrolling should happen instantly in a single jump
- `"auto"`: scroll behavior is determined by the computed value of {{cssxref("scroll-behavior")}}
Expand All @@ -46,7 +45,6 @@ scrollIntoView(options)

- `block` {{optional_inline}}
- : Defines the vertical alignment of the element within the scrollable ancestor container. Its value can be one of the following:

- `"start"`: Aligns the element's top edge with the top of the scrollable container, making the element appear at the start of the visible area vertically.
- `"center"`: Aligns the element vertically at the center of the scrollable container, positioning it in the middle of the visible area.
- `"end"`: Aligns the element's bottom edge with the bottom of the scrollable container, placing the element at the end of the visible area vertically.
Expand All @@ -56,15 +54,13 @@ scrollIntoView(options)

- `container` {{optional_inline}}
- : Defines the scrollable ancestor container. Its value can be one of the following:

- `"all"`: All scrollable containers are impacted (including the viewport).
- `"nearest"`: Only the nearest scrollable container is impacted by the scroll.

The default is `"all"`.

- `inline` {{optional_inline}}
- : Defines the horizontal alignment of the element within the scrollable ancestor container. Its value can be one of the following:

- `"start"`: Aligns the element's left edge with the left of the scrollable container, making the element appear at the start of the visible area horizontally.
- `"center"`: Aligns the element horizontally at the center of the scrollable container, positioning it in the middle of the visible area.
- `"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.
Expand Down