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}
|
isClosable={true}
|
||||||
padding="large"
|
padding="large"
|
||||||
modalVariant={modalVariant}
|
modalVariant={modalVariant}
|
||||||
data-globally-prevent-click-outside
|
dataGloballyPreventClickOutside
|
||||||
>
|
>
|
||||||
<StyledCenteredTitle>
|
<StyledCenteredTitle>
|
||||||
<H1Title title={title} fontColor={H1TitleFontColor.Primary} />
|
<H1Title title={title} fontColor={H1TitleFontColor.Primary} />
|
||||||
|
|||||||
@ -177,6 +177,7 @@ export type ModalProps = React.PropsWithChildren & {
|
|||||||
hotkeyScope?: ModalHotkeyScope;
|
hotkeyScope?: ModalHotkeyScope;
|
||||||
onEnter?: () => void;
|
onEnter?: () => void;
|
||||||
modalVariant?: ModalVariants;
|
modalVariant?: ModalVariants;
|
||||||
|
dataGloballyPreventClickOutside?: boolean;
|
||||||
} & (
|
} & (
|
||||||
| { isClosable: true; onClose?: () => void }
|
| { isClosable: true; onClose?: () => void }
|
||||||
| { isClosable?: false; onClose?: never }
|
| { isClosable?: false; onClose?: never }
|
||||||
@ -198,6 +199,7 @@ export const Modal = ({
|
|||||||
isClosable = false,
|
isClosable = false,
|
||||||
onClose,
|
onClose,
|
||||||
modalVariant = 'primary',
|
modalVariant = 'primary',
|
||||||
|
dataGloballyPreventClickOutside = false,
|
||||||
}: ModalProps) => {
|
}: ModalProps) => {
|
||||||
const isMobile = useIsMobile();
|
const isMobile = useIsMobile();
|
||||||
const modalRef = useRef<HTMLDivElement>(null);
|
const modalRef = useRef<HTMLDivElement>(null);
|
||||||
@ -259,6 +261,9 @@ export const Modal = ({
|
|||||||
transition={{ duration: theme.animation.duration.normal }}
|
transition={{ duration: theme.animation.duration.normal }}
|
||||||
className={className}
|
className={className}
|
||||||
isMobile={isMobile}
|
isMobile={isMobile}
|
||||||
|
data-globally-prevent-click-outside={
|
||||||
|
dataGloballyPreventClickOutside
|
||||||
|
}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</StyledModalDiv>
|
</StyledModalDiv>
|
||||||
|
|||||||
Reference in New Issue
Block a user