New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restoring scroll position takes too long #25030
Comments
Minimal reproductions with no modules: With basic content and no As soon as we start using https://scroll-restore.vercel.app/no-images |
@L422Y, thanks you for your efforts in creating a minimal reproduction! While testing your demos on my iPhone, I noticed an issue: the scroll position is not restored after refreshing the page. This problem is not only present in your demo but also reproducible on nuxt.com and in my own application. Attaching a example video demonstrating the bug. For reference, I am using an iPhone 12 Pro Max running iOS 17.2.1. RPReplay_Final1704305336.MP4 |
@Dananz not sure if that should be a default behavior? 🤔 |
The issue isn't nuxt, it's in upstream vue-router that disables history scroll restoration as soon as a custom ScrollBehavior is defined. This is fixed in my PR by temporarily re-enabling scroll restoration when appropriate: #24960 |
handle first page load and page refresh scenarios (restore scroll position without jumps), fixes hash-navigation when changing pages and browser back/forward positions, especiall when page transitions are involved. fixes nuxt#24941, nuxt#22487, nuxt#25030 and nuxt#19664
handle first page load and page refresh scenarios (restore scroll position without jumps), fixes hash-navigation when changing pages and browser back/forward positions, especiall when page transitions are involved. fixes nuxt#24941, nuxt#22487, nuxt#25030 and nuxt#19664 Signed-off-by: Bernhard Berger <bernhard.berger@gmail.com>
handle first page load and page refresh scenarios (restore scroll position without jumps), fixes hash-navigation when changing pages and browser back/forward positions, especiall when page transitions are involved. fixes nuxt#24941, nuxt#22487, nuxt#25030 and nuxt#19664 Signed-off-by: Bernhard Berger <bernhard.berger@gmail.com>
handle first page load and page refresh scenarios (restore scroll position without jumps), fixes hash-navigation when changing pages and browser back/forward positions, especiall when page transitions are involved. fixes nuxt#24941, nuxt#22487, nuxt#25030 and nuxt#19664 Signed-off-by: Bernhard Berger <bernhard.berger@gmail.com>
handle first page load and page refresh scenarios (restore scroll position without jumps), fixes hash-navigation when changing pages and browser back/forward positions, especiall when page transitions are involved. fixes nuxt#24941, nuxt#22487, nuxt#25030 and nuxt#19664 Signed-off-by: Bernhard Berger <bernhard.berger@gmail.com>
handle first page load and page refresh scenarios (restore scroll position without jumps), fixes hash-navigation when changing pages and browser back/forward positions, especiall when page transitions are involved. fixes nuxt#24941, nuxt#22487, nuxt#25030 and nuxt#19664 Signed-off-by: Bernhard Berger <bernhard.berger@gmail.com>
Environment
Same as
nuxt.com
because Im usingnuxt.com
the example.Reproduction
https://nuxt.com
Steps to reproduce:
ctrl
+R
Describe the bug
Nuxt needs to wait until fully hydrated in order to restore scrolling position.
Other web frameworks are not waiting for full hydration and do it instantly on page load.
Additional context
GIF Example:
Logs
No response
The text was updated successfully, but these errors were encountered: