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

Back to top when changing page. #2156

Open
mistic100 opened this issue Jan 27, 2020 · 5 comments
Open

Back to top when changing page. #2156

mistic100 opened this issue Jan 27, 2020 · 5 comments

Comments

@mistic100
Copy link

@mistic100 mistic100 commented Jan 27, 2020

  • I confirm that this is an issue rather than a question.

Bug report

Steps to reproduce

  1. go to the official documentation https://vuepress.vuejs.org/guide/
  2. scroll to the bottom of the page
  3. click "Getting Started →" in the footer

What is expected?

I navigate to the top of the "Getting started" page

What is actually happening?

I navigate to the bottom of the "Getting started" page

Other relevant information

I found a bunch of old issues and PR regarding this problem, #1071 #1075 #1107 #1108 and it looks like there where a lot of back-and-forth.

The current behavior is really anoying when using the documentation I am writing, the back to top plugin make a bit more useable but it will be much better to have a standard navigation (when you change page, you start at the top).

@mistic100 mistic100 changed the title Back top top when changing page. Back to top when changing page. Jan 27, 2020
@bencodezen
Copy link
Member

@bencodezen bencodezen commented Jan 28, 2020

@mistic100 Great observation. Scroll behavior should not carry over to the next page.

For those wanting to see a reproduction of it, I have a screen recording here:

https://share.getcloudapp.com/v1umkwA7

@AjitZero
Copy link
Contributor

@AjitZero AjitZero commented Feb 9, 2020

Just confirming: I can reproduce this on Firefox, but not in Google Chrome or Safari.

@mistic100
Copy link
Author

@mistic100 mistic100 commented Feb 9, 2020

Correct, on Chrome there is an animation that brings the scroll to the top.

(I am not a fan of this animation by the way, it is laggy when it's the first load of a page)

@kefranabg
Copy link
Collaborator

@kefranabg kefranabg commented Feb 9, 2020

Hi, I confirm that this bug occurs on Firefox 👌

@rNoz
Copy link

@rNoz rNoz commented Apr 28, 2020

Same bug. Any known workaround/hack? I was trying for some time with no luck: afterEach in Vue Router, trying to force timeout with scrollTo 0 but they need user interaction somehow...
I got a workaround after 2 days trying "5 different hacks": update() of Page with scrollTo in small timeouts, forcing to move to top unless the scrollY is different than at the init (user moved in between).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.