From 3e0df406f1823beb9bf47800796c6400c63d0a24 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 11 Dec 2017 20:34:11 +0800 Subject: [PATCH] Fix unexpected scrollTop change --- site/theme/template/Content/MainContent.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/theme/template/Content/MainContent.jsx b/site/theme/template/Content/MainContent.jsx index 475787fc59..280ecc2f75 100644 --- a/site/theme/template/Content/MainContent.jsx +++ b/site/theme/template/Content/MainContent.jsx @@ -75,7 +75,7 @@ export default class MainContent extends React.Component { if (!nextProps || nextProps.location.pathname !== this.props.location.pathname) { this.bindScroller(); } - if (!window.location.hash) { + if (!window.location.hash && nextProps && nextProps.location.pathname !== this.props.location.pathname) { document.body.scrollTop = 0; document.documentElement.scrollTop = 0; return;