mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 11:08:45 +08:00
parent
10afe1372f
commit
6c0c495177
@ -47,9 +47,8 @@ export default class BackTop extends React.Component<BackTopProps, any> {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
const scrollTop = getScroll(props.target(), true);
|
||||
this.state = {
|
||||
visible: scrollTop > props.visibilityHeight,
|
||||
visible: false,
|
||||
};
|
||||
}
|
||||
|
||||
@ -87,6 +86,7 @@ export default class BackTop extends React.Component<BackTopProps, any> {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.handleScroll();
|
||||
this.scrollEvent = addEventListener(this.props.target(), 'scroll', this.handleScroll);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user