mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
This commit is contained in:
parent
945508c895
commit
1247e03a33
@ -44,6 +44,17 @@ export const ModalContent = forwardRef(
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleClickOutside = (event: MouseEvent) => {
|
const handleClickOutside = (event: MouseEvent) => {
|
||||||
|
// Popover should be launched from within Modal but
|
||||||
|
// the Popover containing element is a sibling to modal,
|
||||||
|
// so this is required to ensure `onClose` isn't triggered
|
||||||
|
// when clicking on a popover item
|
||||||
|
if (
|
||||||
|
isClosedOnOutsideClick &&
|
||||||
|
(event.target as HTMLElement).closest('.mm-popover')
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
isClosedOnOutsideClick &&
|
isClosedOnOutsideClick &&
|
||||||
modalDialogRef?.current &&
|
modalDialogRef?.current &&
|
||||||
|
Loading…
Reference in New Issue
Block a user