mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 02:48:55 +08:00
Merge pull request #5202 from z1769057083/master
fix: 修复drawer点击左上角取消动作无响应
This commit is contained in:
commit
363f389ee6
@ -270,14 +270,18 @@ export default class Drawer extends React.Component<DrawerProps> {
|
||||
return ret;
|
||||
}
|
||||
|
||||
handleSelfClose() {
|
||||
const {onClose, store} = this.props;
|
||||
async handleSelfClose() {
|
||||
const {onClose, store, dispatchEvent} = this.props;
|
||||
|
||||
// 如果有子弹框,那么就先不隐藏自己
|
||||
if (store.dialogOpen !== false || store.drawerOpen !== false) {
|
||||
return;
|
||||
}
|
||||
|
||||
const rendererEvent = await dispatchEvent('cancel', this.props.data);
|
||||
if (rendererEvent?.prevented) {
|
||||
return;
|
||||
}
|
||||
// clear error
|
||||
store.updateMessage();
|
||||
onClose();
|
||||
|
Loading…
Reference in New Issue
Block a user