Skip to content
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

Scroll to top not working in firefox when scroll-behavior: smooth is applied #25816

Closed
Chalks opened this issue Feb 15, 2024 · 1 comment · Fixed by #25817
Closed

Scroll to top not working in firefox when scroll-behavior: smooth is applied #25816

Chalks opened this issue Feb 15, 2024 · 1 comment · Fixed by #25817

Comments

@Chalks
Copy link
Contributor

Chalks commented Feb 15, 2024

Environment

Firefox 122.0.1


  • Operating System: Darwin
  • Node Version: v20.10.0
  • Nuxt Version: 3.10.1
  • CLI Version: 3.10.0
  • Nitro Version: 2.8.1
  • Package Manager: [email protected]
  • Builder: -
  • User Config: alias, devServer, postcss, css, modules, app, build, ignore, runtimeConfig, srcDir, ssr, telemetry
  • Runtime Modules: @pinia/[email protected]
  • Build Modules: -

Reproduction

stackblitz reproduction

Describe the bug

When the style scroll-behavior: smooth is applied, navigation to new pages doesn't scroll to top in Firefox.

The issue is that awaiting nextTick in router.options.ts doesn't actually always play nice with Firefox for some reason, I'll open a PR for this shortly since I found a straightforward fix.

Additional context

#19239 discusses this in detail (and many other issues throughout the life of Nuxt). The issue does exist in vue-router, (reproduced in stackblitz). However, vue router seems to have the issue (when reproduced this way) regardless of whether the style includes scroll-behavior: smooth or not. Since there's an easy fix on Nuxt's side (pr), I think it's worth fixing it.

Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant