From 121794e3c0a1e66ea0d954da4aa9b57d6ecd5abb Mon Sep 17 00:00:00 2001 From: Lucas Bordeau Date: Wed, 14 Aug 2024 17:50:18 +0200 Subject: [PATCH] Fixed modal clickoutside (#6624) Modal clickoutside was modified recently. It was considering portaled component like dropdown outside, so comparePixel mode for click outside is needed here. --- .../src/modules/ui/layout/modal/components/Modal.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/twenty-front/src/modules/ui/layout/modal/components/Modal.tsx b/packages/twenty-front/src/modules/ui/layout/modal/components/Modal.tsx index abd6bb2f053e..fe7983082e73 100644 --- a/packages/twenty-front/src/modules/ui/layout/modal/components/Modal.tsx +++ b/packages/twenty-front/src/modules/ui/layout/modal/components/Modal.tsx @@ -1,7 +1,10 @@ import { ModalHotkeyScope } from '@/ui/layout/modal/components/types/ModalHotkeyScope'; import { usePreviousHotkeyScope } from '@/ui/utilities/hotkey/hooks/usePreviousHotkeyScope'; import { useScopedHotkeys } from '@/ui/utilities/hotkey/hooks/useScopedHotkeys'; -import { useListenClickOutsideV2 } from '@/ui/utilities/pointer-event/hooks/useListenClickOutsideV2'; +import { + ClickOutsideMode, + useListenClickOutsideV2, +} from '@/ui/utilities/pointer-event/hooks/useListenClickOutsideV2'; import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile'; import styled from '@emotion/styled'; import { motion } from 'framer-motion'; @@ -205,6 +208,7 @@ export const Modal = ({ onClose(); } }, + mode: ClickOutsideMode.comparePixels, }); const stopEventPropagation = (e: React.MouseEvent) => {