没有显示的时候不要调用 onHide

This commit is contained in:
2betop 2020-05-09 09:30:48 +08:00
parent 7bacf2df39
commit aa6d38600b

View File

@ -108,11 +108,11 @@ export class Drawer extends React.Component<DrawerProps, DrawerState> {
@autobind
handleRootClick(e: MouseEvent) {
const {classPrefix: ns, closeOnOutside, onHide} = this.props;
const {classPrefix: ns, closeOnOutside, onHide, show} = this.props;
if ((e.target as HTMLElement).closest(`.${ns}Drawer-content`)) {
return;
}
closeOnOutside && onHide && onHide();
closeOnOutside && show && onHide && onHide();
}
render() {