Skip to content
This repository has been archived by the owner on Jul 28, 2018. It is now read-only.

Page does not always scroll to the top when DOM loads too fast #653

Open
terracatta opened this issue Jan 5, 2016 · 0 comments
Open

Page does not always scroll to the top when DOM loads too fast #653

terracatta opened this issue Jan 5, 2016 · 0 comments

Comments

@terracatta
Copy link

I believe there is a race condition in Turbolinks where it attempts to change the scroll position to the top of the page before the DOM has been fully replaced, and as a result, the page is not scrolled to the top successfully.

Steps to reproduce.

  1. Start on page A (which should have a lot of content) and scroll to the bottom
  2. Click a link on page A that goes to page B (which should also have a lot of content that requires a scroll bar)
  3. You will be on the top of page B (as expected) now press back
  4. You will be in your former position on page A (as expected) now re-click the link to page B

Expected Result: page B loads and my scroll position is at the top of page B just like before
Actual Result: page B loads but my scroll position remains unchanged from page A

Again, I believe this is a race condition, if you add a simple <100ms timeout to this call then the problem is completely mitigated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant