1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-24 21:07:17 +00:00

fix popover click outside (#7889)

Co-authored-by: zhouwenxuan <aries@Mac.local>
This commit is contained in:
Aries
2025-06-05 13:55:55 +08:00
committed by GitHub
parent 766b2e6f5c
commit 9a72af75af

View File

@@ -48,7 +48,9 @@ class CustomizePopover extends React.Component {
onMouseDown = (e) => {
const { canHidePopover = true } = this.props;
if (!canHidePopover) return;
if (this.popoverRef && e && getEventClassName(e).indexOf('popover') === -1 && !this.popoverRef.contains(e.target)) {
const clickOutside = this.popoverRef && !this.popoverRef.contains(e.target) && !e.target.closest('.popover');
if (clickOutside) {
this.props.hidePopover(e);
}
};