1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

Fix #19856 - Don't autoclose Modals when Popover items are clicked (#19857)

This commit is contained in:
David Walsh 2023-07-05 12:11:49 -05:00 committed by GitHub
parent 945508c895
commit 1247e03a33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,6 +44,17 @@ export const ModalContent = forwardRef(
};
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 (
isClosedOnOutsideClick &&
modalDialogRef?.current &&