diff --git a/frontend/src/components/notifications/Notifications.tsx b/frontend/src/components/notifications/Notifications.tsx index 22f47fa17..df07bf5df 100644 --- a/frontend/src/components/notifications/Notifications.tsx +++ b/frontend/src/components/notifications/Notifications.tsx @@ -67,7 +67,8 @@ export const createNotification = ( ...toastProps, autoClose: toastProps.autoClose || 15000, theme: "dark", - type: myProps?.type || "info" + type: myProps?.type || "info", + className: "pointer-events-auto" }); export const NotificationContainer = () => ( diff --git a/frontend/src/components/v2/Drawer/Drawer.tsx b/frontend/src/components/v2/Drawer/Drawer.tsx index 8bc73bf89..d6c6712ef 100644 --- a/frontend/src/components/v2/Drawer/Drawer.tsx +++ b/frontend/src/components/v2/Drawer/Drawer.tsx @@ -55,6 +55,19 @@ export const DrawerContent = forwardRef( {...props} ref={forwardedRef} className={twMerge(drawerContentVariation({ direction, className }))} + onPointerDownOutside={(e) => { + const target = e.target as HTMLElement; + const toastElement = target.closest('[class*="Toastify"]'); + if (toastElement) { + e.preventDefault(); + return; + } + + if (onClose) { + onClose(); + } + props.onPointerDownOutside?.(e); + }} > {title && ( diff --git a/frontend/src/components/v2/Modal/Modal.tsx b/frontend/src/components/v2/Modal/Modal.tsx index 5e8f65788..6f6a4b416 100644 --- a/frontend/src/components/v2/Modal/Modal.tsx +++ b/frontend/src/components/v2/Modal/Modal.tsx @@ -15,6 +15,7 @@ export type ModalContentProps = Omit void; overlayClassName?: string; showCloseButton?: boolean; + closeOnOutsideClick?: boolean; }; export const ModalContent = forwardRef( @@ -29,6 +30,7 @@ export const ModalContent = forwardRef( bodyClassName, onClose, showCloseButton = true, + closeOnOutsideClick = true, ...props }, forwardedRef @@ -38,7 +40,23 @@ export const ModalContent = forwardRef( className={twMerge("animate-fade-in fixed inset-0 z-30 h-full w-full", overlayClassName)} style={{ backgroundColor: "rgba(0, 0, 0, 0.7)" }} /> - + { + const target = e.target as HTMLElement; + const toastElement = target.closest('[class*="Toastify"]'); + if (toastElement) { + e.preventDefault(); + return; + } + + if (closeOnOutsideClick && onClose) { + onClose(); + } + props.onPointerDownOutside?.(e); + }} + >