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): fix regression with scrollToTop #7920

Merged
merged 7 commits into from Aug 14, 2020
Merged

fix(vue-app): fix regression with scrollToTop #7920

merged 7 commits into from Aug 14, 2020

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Aug 14, 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

vue-router@3.4.0 landed with vuejs/vue-router#3199 which is breaking scrollToTop: false as we need to call triggerScroll event on first page too otherwise it will be delayed until next navigation which causes jumping to top (or saved position of previous page)

PR also introducing some code refactors

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.

@codecov-commenter
Copy link

codecov-commenter commented Aug 14, 2020

Codecov Report

Merging #7920 into dev will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev    #7920   +/-   ##
=======================================
  Coverage   68.92%   68.92%           
=======================================
  Files          91       91           
  Lines        3846     3846           
  Branches     1041     1041           
=======================================
  Hits         2651     2651           
  Misses        971      971           
  Partials      224      224           
Flag Coverage Δ
#unittests 68.92% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b487c7d...43b385a. Read the comment docs.

@pi0 pi0 requested review from Atinux and clarkdo August 14, 2020 20:51
// Page hash changes
(to.path === from.path && to.hash !== from.hash) ||
// Initial load (vuejs/vue-router#3199)
to === from
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@posva Do you think it is a safe check for detecting initial load?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not completely sure, we could also check if from is the START location that is exported in v4.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried exposing START ref but checking here, on initial load from and to are same references but not equal to START:

image

@pi0 pi0 marked this pull request as ready for review August 14, 2020 20:54
@pi0
Copy link
Member Author

pi0 commented Aug 14, 2020

merging to fix ci and test on edge

@pi0 pi0 merged commit 9f4d420 into dev Aug 14, 2020
@pi0 pi0 deleted the fix/scroll-false branch August 14, 2020 21:42
@pi0 pi0 mentioned this pull request Aug 14, 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