fix: dropdown-button 下载无效问题 (#9554)

This commit is contained in:
Allen 2024-01-30 18:47:27 +08:00 committed by GitHub
parent 032ea5ac2c
commit f37c1e6fd3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -237,8 +237,12 @@ export default class DropDownButton extends React.Component<
isOpened: false
});
}, 200);
// PopOver hide会直接调用close方法
e && e.preventDefault();
// 如果是下拉菜单,并且是下载链接,则不阻止默认事件
if (!(e?.target as any)?.getAttribute?.('download')) {
// PopOver hide会直接调用close方法
e && e.preventDefault();
}
}
keepOpen() {