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

Scroll position for historical pages #12

Closed
bcardarella opened this issue Aug 3, 2016 · 1 comment
Closed

Scroll position for historical pages #12

bcardarella opened this issue Aug 3, 2016 · 1 comment

Comments

@bcardarella
Copy link
Member

bcardarella commented Aug 3, 2016

Visit page A, scroll down
From page A, click on Link to page B, scroll down
Back button to page A, previous scroll position is preserved.

Visit page A, scroll down
From page A, click on Link to page B, scroll down
From page B, click on Link to page A
Back button twice to page A, previous scroll position is not preserved.

@bcardarella
Copy link
Member Author

To properly fix this I believe that you should not rely on window.location. Instead modifying Ember's history_location API. When the state is pushed: https://github.com/emberjs/ember.js/blob/c076329e429381925d2416a2fa29ee1e580c7ea7/packages/ember-routing/lib/location/history_location.js#L153

the state should also include a unique ID. This ID should be used to maintain the scroll positions.

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

No branches or pull requests

1 participant