out side click fix
This commit is contained in:
@@ -61,8 +61,10 @@ const TaskDetailPopoverPanel: FC<Props> = ({ anchorRef, children, className, wid
|
|||||||
onClose();
|
onClose();
|
||||||
};
|
};
|
||||||
|
|
||||||
document.addEventListener("pointerdown", handlePointerDown);
|
// Capture: DefaulModal stops pointerdown propagation on bubble, so outside-click
|
||||||
return () => document.removeEventListener("pointerdown", handlePointerDown);
|
// would never reach a document bubble listener while the modal is open.
|
||||||
|
document.addEventListener("pointerdown", handlePointerDown, true);
|
||||||
|
return () => document.removeEventListener("pointerdown", handlePointerDown, true);
|
||||||
}, [anchorRef, onClose]);
|
}, [anchorRef, onClose]);
|
||||||
|
|
||||||
if (!position) return null;
|
if (!position) return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user