From e280efd2960fc354de5a139bf4dcd4b5003a3e1c Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Mon, 19 Jan 2015 19:27:26 +0300 Subject: [PATCH] [changed] Don't restore scroll position on Forward 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 #707. --- modules/createRouter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/createRouter.js b/modules/createRouter.js index a06a0a2713..22a55bd8f1 100644 --- a/modules/createRouter.js +++ b/modules/createRouter.js @@ -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);