mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-05 23:46:28 +08:00
remove repeat hash jump
This commit is contained in:
parent
01d4acb7a9
commit
f9273bc95a
@ -61,20 +61,9 @@ export default class MainContent extends React.Component {
|
|||||||
if (!location.hash) {
|
if (!location.hash) {
|
||||||
document.body.scrollTop = 0;
|
document.body.scrollTop = 0;
|
||||||
document.documentElement.scrollTop = 0;
|
document.documentElement.scrollTop = 0;
|
||||||
} else {
|
|
||||||
if (this.timer) {
|
|
||||||
clearTimeout(this.timer);
|
|
||||||
}
|
|
||||||
this.timer = setTimeout(() => {
|
|
||||||
document.getElementById(decodeURI(location.hash.replace('#', ''))).scrollIntoView();
|
|
||||||
}, 10);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
|
||||||
clearTimeout(this.timer);
|
|
||||||
}
|
|
||||||
|
|
||||||
handleMenuOpenChange = (openKeys) => {
|
handleMenuOpenChange = (openKeys) => {
|
||||||
this.setState({ openKeys });
|
this.setState({ openKeys });
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user