← 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
- Specification: https://github.com/WICG/navigation-api/pull/239
- Firefox: No signal — https://github.com/mozilla/standards-positions/issues/543 remains open as the positions request for the original API.
- Safari: No signal — https://www.mail-archive.com/webkit-dev@lists.webkit.org/msg30257.html remains open as the positions request for the original API.
- Web developers: Positive — https://github.com/WICG/navigation-api/issues/237 came out of discussions with web developers.
- Tracking bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1336000
View on chromestatus.com