Browse Source

fix hash jump again

pull/7370/head 2.12.8
afc163 7 years ago
parent
commit
65c86e60ce
  1. 11
      site/theme/template/Content/MainContent.jsx

11
site/theme/template/Content/MainContent.jsx

@ -61,7 +61,18 @@ export default class MainContent extends React.Component {
if (!location.hash) {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
return;
}
if (this.timer) {
clearTimeout(this.timer);
}
this.timer = setTimeout(() => {
location.hash = location.hash;
}, 10);
}
componentWillUnmount() {
clearTimeout(this.timer);
}
handleMenuOpenChange = (openKeys) => {

Loading…
Cancel
Save