Skip to content
Discussion options

You must be logged in to vote

The behavior is the same as the browser, and it's based on locations, not URLs.

  1. Push navigations (new location) scrolls to the top
  2. Pop navigations (browser back/forward button clicks) will restore the position for that location (not URL)

For example:

  1. User lands on / and scrolls down 100px
  2. User clicks a link /contact
    • Scroll is moved to top
  3. User scrolls down 200px
  4. User clicks a link to /
    • scroll is moved to the top
    • while it is the same URL as (1) it is not the same "location", it's a new location so scroll is reset to the top
  5. User clicks "back" to "/contact"
    • scroll is restored to 200px from (3)
  6. User clicks "back" to "/"
    • scroll is restored to 100px from (1)

If you are not expe…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@QuentinWidlocher
Comment options

Comment options

You must be logged in to vote
3 replies
@QuentinWidlocher
Comment options

@QuentinWidlocher
Comment options

@lili21
Comment options

Answer selected by ryanflorence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants