issue was the modal was closing itself due to onclickoutside while it
should have been excluded

fixes https://github.com/twentyhq/twenty/issues/12512
This commit is contained in:
Guillim
2025-06-10 14:44:25 +02:00
committed by GitHub
parent f0f0d85380
commit b74f6901b4
2 changed files with 6 additions and 1 deletions

View File

@ -116,7 +116,7 @@ export const ConfirmationModal = ({
isClosable={true}
padding="large"
modalVariant={modalVariant}
data-globally-prevent-click-outside
dataGloballyPreventClickOutside
>
<StyledCenteredTitle>
<H1Title title={title} fontColor={H1TitleFontColor.Primary} />

View File

@ -177,6 +177,7 @@ export type ModalProps = React.PropsWithChildren & {
hotkeyScope?: ModalHotkeyScope;
onEnter?: () => void;
modalVariant?: ModalVariants;
dataGloballyPreventClickOutside?: boolean;
} & (
| { isClosable: true; onClose?: () => void }
| { isClosable?: false; onClose?: never }
@ -198,6 +199,7 @@ export const Modal = ({
isClosable = false,
onClose,
modalVariant = 'primary',
dataGloballyPreventClickOutside = false,
}: ModalProps) => {
const isMobile = useIsMobile();
const modalRef = useRef<HTMLDivElement>(null);
@ -259,6 +261,9 @@ export const Modal = ({
transition={{ duration: theme.animation.duration.normal }}
className={className}
isMobile={isMobile}
data-globally-prevent-click-outside={
dataGloballyPreventClickOutside
}
>
{children}
</StyledModalDiv>