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:
@@ -48,7 +48,9 @@ class CustomizePopover extends React.Component {
|
|||||||
onMouseDown = (e) => {
|
onMouseDown = (e) => {
|
||||||
const { canHidePopover = true } = this.props;
|
const { canHidePopover = true } = this.props;
|
||||||
if (!canHidePopover) return;
|
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);
|
this.props.hidePopover(e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user