You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the experimental.scrollRestoration: true feature is enabled, the resulting replaceState triggered by each scroll event will (potentially depending on caching, I assume) cause Chrome to re-request the favicon URL.
(I'm not sure why Chrome would re-request that just for a replaceState, that doesn't seem necessary, but it's happening nonetheless.)
To Reproduce
Enable experimental.scrollRestoration: true in your app.
Start the app and open the Network panel.
Scroll the page.
Expected behavior
Scrolling should not cause network requests.
Screenshots
System information
macOS
Chrome (maybe others)
Next.js 9.5.2
Additional context
Maybe a solution would be to capture the scroll position the moment before the page changes, instead of on every scroll event? Was that tried already?
The text was updated successfully, but these errors were encountered:
…20633)
This pull request adjusts our experimental scroll restoration behavior to use `sessionStorage` as opposed to `History#replaceState` to track scroll position.
In addition, **it eliminates a scroll event listener** and only captures when a `pushState` event happens (thereby leaving state that needs snapshotted).
These merely adjusts implementation detail, and is covered by existing tests:
```
test/integration/scroll-back-restoration/
```
---
Fixes#16690Fixes#17073Fixes#20486
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
vercel
locked as resolved and limited conversation to collaborators
Jan 28, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug report
Describe the bug
When the
experimental.scrollRestoration: true
feature is enabled, the resultingreplaceState
triggered by each scroll event will (potentially depending on caching, I assume) cause Chrome to re-request the favicon URL.(I'm not sure why Chrome would re-request that just for a
replaceState
, that doesn't seem necessary, but it's happening nonetheless.)To Reproduce
experimental.scrollRestoration: true
in your app.Expected behavior
Scrolling should not cause network requests.
Screenshots
System information
Additional context
Maybe a solution would be to capture the scroll position the moment before the page changes, instead of on every scroll event? Was that tried already?
The text was updated successfully, but these errors were encountered: