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(vue-app): triggerScroll when transitions is disabled #8225

Merged
merged 2 commits into from
Nov 6, 2020

Conversation

pimlie
Copy link

@pimlie pimlie commented Oct 20, 2020

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

On a normal page change nuxt relies on the routeEnter hook of the transition to emit a triggerScroll event to resolve the scrollBehaviour: https://github.com/nuxt/nuxt.js/blob/dev/packages/vue-app/template/App.js#L65

When you set features.transitions: false then this event is never emitted, so scrollBehaviour is broken. This pr fixes that by always emitting triggerScroll in fixPrepatch when you've set features.transitions = false

The proposed change should work fine as the minifier should be able to remove the constant condition that exists when transitions = false

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. (PR: #)
  • I have added tests to cover my changes (if not applicable, please state why)
  • All new and existing tests are passing.

@pi0 pi0 changed the title fix: triggerScroll when transitions: false fix(vue-app): triggerScroll when transitions: false Nov 6, 2020
@pi0 pi0 changed the title fix(vue-app): triggerScroll when transitions: false fix(vue-app): triggerScroll when transitions is false Nov 6, 2020
@pi0 pi0 changed the title fix(vue-app): triggerScroll when transitions is false fix(vue-app): triggerScroll when transitions is disabled Nov 6, 2020
@pi0 pi0 merged commit 2c6610c into nuxt:dev Nov 6, 2020
@pi0 pi0 mentioned this pull request Nov 6, 2020
@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants