Uh oh!
There was an error while loading. Please reload this page.
fix(nuxt): scroll to top on dynamic routes with different params - #8327
Conversation
|
✅ Deploy Preview for nuxt3-docs canceled.
|
Uh oh!
There was an error while loading. Please reload this page.
chrisnoden
commented
Nov 4, 2022
I've updated to rc.13 and am not seeing that this issue is fixed. Navigating to a fresh "page" and the scroll position does not return to the top of the page. |
atinux
commented
Nov 4, 2022
It should, can you confirm you don't have a |
chrisnoden
commented
Nov 4, 2022
I do not have that file. I removed my .nuxt and node_modules before updating to rc.13 and have also updated the @nuxtjs libs. My project works fine in all other respects (so far) but navigating (via NuxtLink) to a fresh page from, eg the footer nav, and the scroll position remains so that the footer is still in view and the actual change to the body can't be seen because it is above the fold. I'll check it on my minimal nuxt project. |
Confirmed. I tested in a bare bones (only nuxt rc.13) project and if my NuxtLink is at the bottom of a long page, clicking it does not cause the browser to scroll to the top. So, this bug is still not resolved. I am unable to get rc6 to run now, but from my perspective this issue started with rc7. LINKED: nuxt/nuxt#14544 |
misaon
commented
Nov 4, 2022
Same problem. Nested pages scroll to top is not implemented too. |
chrisnoden
commented
Nov 4, 2022
Here's my minimal project which demonstrates the issue: |
atinux
commented
Nov 4, 2022
Alright I found the bug, it comes after we removed the transitions by default (PR #8463) cc @danielroe The hooks to wait is To fix that, you can define the |
Resolves a regression from #8463 Learn more in the comments from #8327
atinux
commented
Nov 4, 2022
Opened a PR to fix this: #8700 Really sorry about the regression 😢 |
chrisnoden
commented
Nov 5, 2022
Thanks for the prompt attention. I can confirm this fixes #8327 (also nuxt/nuxt#15356) |
🔗 Linked issue
❓ Type of change
📚 Description
Improvement over #3851 so we scroll to top when it's the same page but with different params.
Example: Going from
/movies/14to/movies/15should scroll to top.I am only using params to
/moviesto/movies?q=testdoes not scroll to top.📝 Checklist