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

fix(nuxt): scroll to top by default on dynamic routes #22403

Merged
merged 18 commits into from Sep 6, 2023

Conversation

huang-julien
Copy link
Member

@huang-julien huang-julien commented Jul 30, 2023

πŸ”— Linked issue

resolve #22402

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Hi πŸ‘‹ this PR change the _isDifferentRoute from router.options.ts so routes with the same component can also get scrolled to top after page switch

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

todo

  • fixtures tests

@stackblitz
Copy link

stackblitz bot commented Jul 30, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@huang-julien huang-julien changed the title fix(nuxt): fix isDifferentRoute util in router.oiptions fix(nuxt): fix isDifferentRoute utils in router.oiptions Jul 30, 2023
@huang-julien huang-julien changed the title fix(nuxt): fix isDifferentRoute utils in router.oiptions fix(nuxt): use route.path instead of comparing matched components in _isDifferentRoute() Jul 30, 2023
@huang-julien huang-julien marked this pull request as ready for review July 30, 2023 22:04
@nuxt-studio
Copy link

nuxt-studio bot commented Aug 1, 2023

βœ… Live Preview ready!

Name Edit Preview Latest Commit
Nuxt Docs Edit on Studio β†—οΈŽ View Live Preview eeada97

@danielroe danielroe changed the title fix(nuxt): use route.path instead of comparing matched components in _isDifferentRoute() fix(nuxt): scroll to top for every different path, not just ones with different components Sep 6, 2023
@danielroe danielroe changed the title fix(nuxt): scroll to top for every different path, not just ones with different components fix(nuxt): scroll to top by default on dynamic routes Sep 6, 2023
@danielroe danielroe merged commit 48fb6e2 into nuxt:main Sep 6, 2023
26 checks passed
@github-actions github-actions bot mentioned this pull request Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scroll to top is not triggered on routes with the same component.
4 participants