modal fix (#12514)
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:
@ -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} />
|
||||
|
||||
@ -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>
|
||||
|
||||
Reference in New Issue
Block a user