From 98abaa921bf5ef4833501c7461f27e208763cdf1 Mon Sep 17 00:00:00 2001 From: ivaosthu Date: Thu, 29 Dec 2016 14:01:03 +0100 Subject: [PATCH] only keep scroll-position for back/forward actions --- frontend/src/component/app.jsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/frontend/src/component/app.jsx b/frontend/src/component/app.jsx index 924714f767..9369a62d80 100644 --- a/frontend/src/component/app.jsx +++ b/frontend/src/component/app.jsx @@ -93,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 && } {caption} - ; + ; return (
@@ -119,7 +126,7 @@ export default class App extends Component { {createListItem('/applications', 'Applications', 'apps')} - +