question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NuxtLink retains scroll position

See original GitHub issue

Environment

  • 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:closed
  • Created a year ago
  • Reactions:6
  • Comments:21 (7 by maintainers)

github_iconTop GitHub Comments

7reactions
chrisnodencommented, Aug 16, 2022
6reactions
silvio-ecommented, Sep 4, 2022

It still happens for me in RC-9.

And in combination with #5152 it’s quite a faulty navigation experience atm…

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found