Problem with scroll restoration (nextjs 13) #44013
Replies: 22 comments 13 replies
-
Hey which next.js version are you using? They removed some additional div's in this version v13.0.7-canary.2. It can fix your error. |
Beta Was this translation helpful? Give feedback.
-
@ciruz Hey thanks man, yes will |
Beta Was this translation helpful? Give feedback.
-
Any help? I've test it with latest canary release v13.0.8-canary.0 still there. |
Beta Was this translation helpful? Give feedback.
-
My config file:
|
Beta Was this translation helpful? Give feedback.
-
I've highlighted this issue a few times over the last few months, still seeing it today on the latest canary. I believe this is the related issue: #42492 |
Beta Was this translation helpful? Give feedback.
-
Is the scrollRestoration bug already fixed? |
Beta Was this translation helpful? Give feedback.
-
Any update? |
Beta Was this translation helpful? Give feedback.
-
Still happens with 13.2.4. |
Beta Was this translation helpful? Give feedback.
-
Any update? |
Beta Was this translation helpful? Give feedback.
-
Still happens with 13.4.5... |
Beta Was this translation helpful? Give feedback.
-
In my case I had an element (Image) positioned as sticky (tailwind) to the route I am navigating to. When I remove sticky, scroll restoration works fine, when I add back it does not, also position fixed does not work as well. Solution for me was to add extra empty div before the sticky or fixed positioned element.
If relevant I am on version |
Beta Was this translation helpful? Give feedback.
-
still problem scroll restoration |
Beta Was this translation helpful? Give feedback.
-
CHRIST HOW IS THIS STILL HAPPENING IN NEXTJS? |
Beta Was this translation helpful? Give feedback.
-
Seems to be fine with |
Beta Was this translation helpful? Give feedback.
-
It happens randomly in version 14.1.0 |
Beta Was this translation helpful? Give feedback.
-
What's the current state of affairs? I updated to 13.5.6 but the issue remains. This is really annoying. |
Beta Was this translation helpful? Give feedback.
-
any update on this? |
Beta Was this translation helpful? Give feedback.
-
Hey, there // next.config.mjs
experimental: {
scrollRestoration: true,
} const router = useRouter(); // "next/navigation"
...
router.push('/mypage', { scroll: false }); next.js version: 14.2.3 |
Beta Was this translation helpful? Give feedback.
-
Update guys? |
Beta Was this translation helpful? Give feedback.
-
It happens randomly in version 15.1.3. Any solutions here cannot work. |
Beta Was this translation helpful? Give feedback.
-
scroll restoration doesn't work for me in 15.3.2 |
Beta Was this translation helpful? Give feedback.
-
Hello! Is there a workaround for this? We're seeing impact in CLS due to this behavior. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a hobby project, which I rebuild with nextjs, and I use 13th version. Everything actually works as expected with new app directory and I really enjoy that. I wanna go with couple production projects within 13 version, but have problem with scroll restoration, it simply doesn't works, or works incorrect.
Image I'm on middle of home page:

After click on unit (team) for example 28ths Flamingos and go to the unit page:

so next for some reason scroll a bit, or do not scroll to top.
Expected result:

I used a next/link
How to fix it?
Beta Was this translation helpful? Give feedback.
All reactions