← Back to release summary

navigateEvent.scroll()

Category
Miscellaneous
Type
No developer-visible change
Status
Enabled by default (Chrome 105)
Intent stage
Shipped

Summary

scroll() works very similarly to the existing restoreScroll() except that it can be called when the navigation is not a traversal. It also allows manually performing the scroll even when not in manual scroll mode.

Motivation

When initially desiging restoreScroll(), we were thinking (as the name implies) of restoring scroll position during a traversal. However, web developers may want to precisely control the timing of scroll during a non-traversal same-document navigation. See https://github.com/WICG/navigation-api/issues/237

Standards & signals

View on chromestatus.com