diff --git a/frontend/package.json b/frontend/package.json
index 0dbb7ee4f8..74343f8386 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -45,6 +45,7 @@
"react-modal": "^1.6.4",
"react-redux": "^4.4.5",
"react-router": "^3.0.0",
+ "react-router-scroll": "^0.4.1",
"redux": "^3.6.0",
"redux-thunk": "^2.1.0",
"whatwg-fetch": "^2.0.0"
diff --git a/frontend/src/component/app.jsx b/frontend/src/component/app.jsx
index 838a00b2ab..9369a62d80 100644
--- a/frontend/src/component/app.jsx
+++ b/frontend/src/component/app.jsx
@@ -9,6 +9,7 @@ import ErrorContainer from './error/error-container';
import UserContainer from './user/user-container';
import ShowUserContainer from './user/show-user-container';
+import { ScrollContainer } from 'react-router-scroll';
const base = {
name: 'Unleash',
@@ -42,10 +43,6 @@ export default class App extends Component {
if (this.props.location.pathname !== nextProps.location.pathname) {
clearTimeout(this.timer);
this.timer = setTimeout(() => {
- window.requestAnimationFrame(() => {
- document.querySelector('.mdl-layout__content').scrollTop = 0;
- });
-
const layout = document.querySelector('.mdl-js-layout');
const drawer = document.querySelector('.mdl-layout__drawer');
// hack, might get a built in alternative later
@@ -96,12 +93,19 @@ export default class App extends Component {
}
render () {
+ const shouldUpdateScroll = (prevRouterProps, { location }) => {
+ if (prevRouterProps && location.pathname !== prevRouterProps.location.pathname) {
+ return location.action === 'POP';
+ } else {
+ return [0, 0];
+ }
+ };
const createListItem = (path, caption, icon) =>
-
{icon &&