Version 4.6.0: Scroll to the top when reloading instead of maintaining the scroll position #2589
-
|
Since upgrading from 4.5.1 to 4.6.0, I have noticed unusual scrolling behavior when I scroll down a page and refresh it via the browser. Unfortunately, I am uncertain whether this is a bug or if there is a new setting in version 4.6.0 that I am missing. What happens with version 4.6.0:
What I expect (as in 4.5.1):
I have created a small demo package to reproduce the problem. Download, install dependencies, go into dev mode, open frontend, navigate to the about page, scroll down, reload the page. I also activated scroll-behavior: smooth; in app.vue, which visualizes the problem even better. I use MacOS (26.1 (25B78)) with Chrome (142.0.7444.176). I can also reproduce it in Firefox. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
|
This could be related to Nuxt. There are e2e tests in the vue-router to test this behavior and you can also test it manually with the playground in the repo and the |
Beta Was this translation helpful? Give feedback.
Ah I think I see what you mean, it's when you reload after immediately navigating somewhere and scrolling around. This is because of e0e38ab. Removing
beforeunloadwas necessary so now there is this specific case where the save of the scroll position doesn't work. I added this to #2403 to not forget