diff --git a/website/src/components/ScrollToTop.js b/website/src/components/ScrollToTop.js index 3046aee62..1cd17164a 100644 --- a/website/src/components/ScrollToTop.js +++ b/website/src/components/ScrollToTop.js @@ -3,8 +3,7 @@ import { withRouter } from 'react-router-dom' class ScrollToTop extends Component { componentDidUpdate(prevProps) { - console.log(this.props.location !== prevProps.location) - if (this.props.location !== prevProps.location) { + if (this.props.location.pathname !== prevProps.location.pathname) { window.scrollTo(0, 0) } } diff --git a/website/src/index.js b/website/src/index.js index 7a2d09f8a..5a2d1b8af 100644 --- a/website/src/index.js +++ b/website/src/index.js @@ -16,7 +16,7 @@ import Nav from './components/nav/Nav' import MiniNav from './components/nav/MiniNav' import Home from './components/pages/Home' import Header from './components/Header' -//import ScrollToTop from './components/ScrollToTop' +import ScrollToTop from './components/ScrollToTop' //import MobileNav from './components/nav/mobile/MobileNav' import { getRoutes } from './SiteMap' import registerServiceWorker from './registerServiceWorker' @@ -60,12 +60,12 @@ class App extends Component { render( -
+ -
+
, document.getElementById('root') )