Skip to content

Commit

Permalink
Fix unexpected scrollTop change
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Dec 11, 2017
1 parent d1568c9 commit 3e0df40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion site/theme/template/Content/MainContent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3e0df40

Please sign in to comment.