mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
site: still need the fallback scrollIntoView, #12683
This commit is contained in:
parent
557683c764
commit
934b92b943
@ -74,9 +74,17 @@ export default class MainContent extends React.PureComponent {
|
||||
this.bindScroller();
|
||||
}
|
||||
if (!window.location.hash && prevProps && prevProps.location.pathname !== location.pathname) {
|
||||
document.body.scrollTop = 0;
|
||||
document.documentElement.scrollTop = 0;
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (
|
||||
window.location.hash
|
||||
&& document.querySelector(decodeURIComponent(window.location.hash))
|
||||
&& document.documentElement.scrollTop === 0
|
||||
) {
|
||||
document.querySelector(decodeURIComponent(window.location.hash)).scrollIntoView();
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
|
Loading…
Reference in New Issue
Block a user