-
Notifications
You must be signed in to change notification settings - Fork 44
Page scroll position #6
Comments
This library shouldn't do anything with scrolling, with the exception of optionally disabling scrolling during transitions with the |
It is possible to adapt the |
This appears to be related to vercel/next.js#1309. TL;DR this is all handled by the browser, and it appears that simply adding transitions makes changing pages take long enough that the browser gives up on trying to restore the previous scroll position. I think the only reason that maintaining scroll position works for some Next.js pages is because they aren't loading data, and thus the page change completes quick enough that the browser can do its usual scroll position restoration. Given that this is a problem with Next.js itself and this library only makes the problem apparent (it isn't actually the root cause), I'm going to close out this issue. As @arunoda suggested in the other issue, this should be implemented in another userspace package. Solving this problem is beyond the scope of |
What happens
When clicking the back button on a browser the page y . scroll position is set to the top of the page. This is a critical issue for many use cases as on long scrolling results pages the user would have to re-find their position in the page.
Expected
The scroll position is remembered and the page transitions back to the previous position. As per normal NextJs behaviour.
The text was updated successfully, but these errors were encountered: