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

Default scroll behavior without page transition is broken in rc.13 #15364

Closed
greimela opened this issue Nov 4, 2022 · 0 comments · Fixed by nuxt/framework#8700
Closed

Default scroll behavior without page transition is broken in rc.13 #15364

greimela opened this issue Nov 4, 2022 · 0 comments · Fixed by nuxt/framework#8700

Comments

@greimela
Copy link

greimela commented Nov 4, 2022

Environment

  • Operating System: Darwin
  • Node Version: v16.13.1
  • Nuxt Version: 3.0.0-rc.13
  • Nitro Version: 0.6.1
  • Package Manager: yarn@1.22.15
  • Builder: vite
  • User Config: alias, app, build, modules, progress, plausible, runtimeConfig, vite
  • Runtime Modules: @nuxtjs/tailwindcss@6.1.3, nuxt-progress@0.1.6, vue-plausible@1.3.2
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-ruxdek?file=pages/index.vue

Describe the bug

Reproduction:

  • Have two pages, each with more than 100vh width.
  • Scroll down on page 1
  • Navigate to page 2

Expected behavior:

  • Page 2 should scroll to top

Actual behavior:

  • Page 2 stays at the scroll position of page 1

The reason is that router.options.ts falsely thinks that an undefined page transition is true, meaning it HAS a transition.
https://github.com/nuxt/framework/blob/bde96947333501c22a5e981515bd27c24eb8b88f/packages/nuxt/src/pages/runtime/router.options.ts#L34

Whereas page.mjs correctly interprets an undefined transition as false.
https://github.com/nuxt/framework/blob/bde96947333501c22a5e981515bd27c24eb8b88f/packages/nuxt/src/pages/runtime/page.ts#L46

I will submit a PR to fix this issue.

Additional context

No response

Logs

No response

@greimela greimela changed the title Default scroll behavior without page transition is broken in rc-13 Default scroll behavior without page transition is broken in rc.13 Nov 4, 2022
greimela referenced this issue in greimela/nuxt-framework Nov 4, 2022
Related issue: https://github.com/nuxt/framework/issues/8699

`router.options.ts` falsely thinks that an `undefined` page transition is `true`, meaning it HAS a transition.

Whereas `page.mjs` correctly interprets an `undefined` transition as `false`.
@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
2 participants