NuxtLink retains scroll position
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v16.15.1
- Nuxt Version:
3.0.0-rc.7
- Package Manager:
yarn@1.22.19
- Builder:
vite
- User Config:
build
,buildModules
,css
,googleFonts
,modules
,nitro
,runtimeConfig
- Runtime Modules:
@storyblok/nuxt@4.1.0
- Build Modules:
@nuxtjs/tailwindcss@5.3.1
,@nuxtjs/google-fonts@1.3.0
Reproduction
<NuxtLink :to="/page2">Link</NuxtLink>
Describe the bug
If you have reasonably long pages and common links near the bottom, clicking a link loads the target page content, but the scroll position no longer goes to the top of the new page.
Additional context
Reverting to rc.6
reverts the behaviour to the expected “jump to top of new page”.
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:6
- Comments:21 (7 by maintainers)
Top Results From Across the Web
Nuxt.js | How to retain Scroll Position when returning to page ...
The Nuxt framework already provides a feature to preserve the scroll position when returning to a page if the user clicks the browser's...
Read more >Keep scroll position when returning to page - nuxt.js
We have to set the position to false to retain the scroll position. To remember the scroll position we can use a package...
Read more >The scrollToTop Property - Nuxt
The scrollToTop property lets you tell Nuxt to scroll to the top before rendering the page. ... but with children routes, Nuxt keeps...
Read more >Why doesn't my page scroll to top every time I click on a teaser ...
People are used to retain scroll position when using the back button and scroll to the top when navigating via link.
Read more >API: The scrollToTop Property - Nuxt.js
By default, Nuxt.js scrolls to the top when you go to another page, but with children routes, Nuxt.js keeps the scroll position. If...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Here’s a minimal project to demonstrate the issue @manniL
https://github.com/chrisnoden/nuxt3-bug
Here is a video of what happens:
https://user-images.githubusercontent.com/2600554/184929397-97e614d2-73c2-4b77-a946-fd0af52bc975.mov
It still happens for me in RC-9.
And in combination with #5152 it’s quite a faulty navigation experience atm…