Skip to content

Commit 6609308

Browse files
authored
Merge pull request #24515 from allroundexperts/fix-15289-followup
fix: popover without overlay changes
2 parents d38c06c + 9ba7700 commit 6609308

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/components/PopoverProvider/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ function PopoverContextProvider(props) {
4848
}, [closePopover]);
4949

5050
React.useEffect(() => {
51-
const listener = () => {
51+
const listener = (e) => {
52+
if (!activePopoverRef.current || !activePopoverRef.current.ref || !activePopoverRef.current.ref.current || activePopoverRef.current.ref.current.contains(e.target)) {
53+
return;
54+
}
5255
closePopover();
5356
};
5457
document.addEventListener('contextmenu', listener);

src/components/PopoverWithoutOverlay/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ function Popover(props) {
3535
} else {
3636
props.onModalHide();
3737
close(props.anchorRef);
38+
Modal.onModalDidClose();
3839
}
3940
Modal.willAlertModalBecomeVisible(props.isVisible);
4041
Modal.setCloseModal(props.isVisible ? () => props.onClose(props.anchorRef) : null);

0 commit comments

Comments
 (0)