Skip to content

Make explicit that scrollIntoView 'nearest' is only done if needed#44667

Open
joshkel wants to merge 1 commit into
mdn:mainfrom
joshkel:patch-1
Open

Make explicit that scrollIntoView 'nearest' is only done if needed#44667
joshkel wants to merge 1 commit into
mdn:mainfrom
joshkel:patch-1

Conversation

@joshkel

@joshkel joshkel commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

In comparing native DOM capabilities with NPM packages like scroll-into-view-if-needed, it was not clear to me that scrollIntoView with 'nearest' only scrolls if needed.

Description

Make scrollIntoView nearest behavior more explicit.

Motivation

In comparing native DOM capabilities with NPM packages like scroll-into-view-if-needed, it was not clear to me that scrollIntoView with 'nearest' only scrolls if needed.

Additional details

Related issues and pull requests

In comparing native DOM capabilities with NPM packages like [scroll-into-view-if-needed](https://www.npmjs.com/package/scroll-into-view-if-needed), it was not clear to me that `scrollIntoView` with `'nearest'` only scrolls if needed.
@joshkel joshkel requested a review from a team as a code owner July 8, 2026 14:49
@joshkel joshkel requested review from pepelsbey and removed request for a team July 8, 2026 14:49
@github-actions github-actions Bot added Content:WebAPI Web API docs size/xs [PR only] 0-5 LoC changed labels Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebAPI Web API docs size/xs [PR only] 0-5 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants