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

The scrollBehavior (usually used to scroll to top on route change) animation triggers at the wrong time. #15059

Closed
alexanderhorner opened this issue Sep 29, 2022 · 2 comments

Comments

@alexanderhorner
Copy link

Environment

Shouldn't matter but:

  • Operating System: Darwin
  • Node Version: v18.9.1
  • Nuxt Version: 3.0.0-rc.11
  • Nitro Version: 0.5.4
  • Package Manager: npm@8.19.1
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://github.com/Willibald-Gluck-Gymnasium/wgg-homepage

Configure the scrollBehavior option of the router like this (standard way to make it scroll to the top on route change):

// app/router.options.ts
import type { RouterOptions } from '@nuxt/schema'

export default <RouterOptions> {
  scrollBehavior() {
    return { top: 0 }
  }
}
``

### Describe the bug

When you trigger a route change (by e.g. clicking on a link), the page _immediately_ scrolls to the top, before the new page even loaded. 

The correct behavior should be completely seamless. You shouldn't see the scroll happening. When the new page renders, it should be at the configured position (usually at the top).

### Additional context

_No response_

### Logs

_No response_
@alexanderhorner
Copy link
Author

Referencing configurable scrollBehavior #12732

@danielroe
Copy link
Member

Let's track in #13284.

@danielroe danielroe closed this as not planned Won't fix, can't repro, duplicate, stale Sep 29, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe transferred this issue from nuxt/framework Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants