Open l-you opened 1 year ago
I have the same problem. In the local environment, scroll restore is enabled. If you build it and go up to the development environment, the scroll is only IOS. Ios Chrome also scrolls back up to the top. Next13.5.6 is in use. First, I am implementing it by switching only to history.scrollRestoration.
I have the same problem. In the local environment, scroll restore is enabled. If you build it and go up to the development environment, the scroll is only IOS. Ios Chrome also scrolls back up to the top. Next13.5.6 is in use. First, I am implementing it by switching only to history.scrollRestoration.
I was forced to make my implementation of scroll restoration. I've made it as a library. Feel free to take a look. But in newer versions of NextJs sometimes it works incorrectly. I would be glad if someone suggested a better solution.
Verify canary release
Provide environment information
Which example does this report relate to?
https://nextjs.org
What browser are you using? (if relevant)
IOS Safari 16.6
Describe the Bug
When using the browser's provided back button following a quick upward swipe, the scroll position resets for the previous page. Please note that this issue only occurs in iOS Safari and cannot be replicated in IOS Chrome.
Expected Behavior
Scroll position should be restored.
To Reproduce
Please look at the following video.
https://github.com/vercel/next.js/assets/32598874/9c245a29-d8c8-4aff-a434-dc021ec6d2c1
Update: Seems like a general bug for every website for both
manual
andauto
scroll restoration only on IOS Safari. Here is screen recording of reproduction on google.com website.https://github.com/vercel/next.js/assets/32598874/f017e150-b7d1-4d36-a88c-2955e5bad265