Skip to content

Commit

Permalink
[changed] Don't restore scroll position on Forward
Browse files Browse the repository at this point in the history
We can't reliably restore scroll position on Forward due to browser differences and incompatibilities.
Instead, we will only restore previous scroll position when user presses Back, and scroll to top on Forward.

Fixes remix-run#707.
  • Loading branch information
gaearon committed Jan 26, 2015
1 parent 8a1b630 commit e280efd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/createRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ function createRouter(options) {

// Record the scroll position as early as possible to
// get it before browsers try update it automatically.
if (prevPath && action !== LocationActions.REPLACE)
if (prevPath && action === LocationActions.PUSH)
this.recordScrollPosition(prevPath);

var match = this.match(path);
Expand Down

0 comments on commit e280efd

Please sign in to comment.