Skip to content

Commit

Permalink
Merge pull request Expensify#24515 from allroundexperts/fix-15289-fol…
Browse files Browse the repository at this point in the history
…lowup

fix: popover without overlay changes
  • Loading branch information
Beamanator authored Aug 22, 2023
2 parents d38c06c + 9ba7700 commit 6609308
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/PopoverProvider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ function PopoverContextProvider(props) {
}, [closePopover]);

React.useEffect(() => {
const listener = () => {
const listener = (e) => {
if (!activePopoverRef.current || !activePopoverRef.current.ref || !activePopoverRef.current.ref.current || activePopoverRef.current.ref.current.contains(e.target)) {
return;
}
closePopover();
};
document.addEventListener('contextmenu', listener);
Expand Down
1 change: 1 addition & 0 deletions src/components/PopoverWithoutOverlay/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function Popover(props) {
} else {
props.onModalHide();
close(props.anchorRef);
Modal.onModalDidClose();
}
Modal.willAlertModalBecomeVisible(props.isVisible);
Modal.setCloseModal(props.isVisible ? () => props.onClose(props.anchorRef) : null);
Expand Down

0 comments on commit 6609308

Please sign in to comment.