mirror of
https://github.com/lingble/twenty.git
synced 2025-11-01 05:07:56 +00:00
[ Fix ] [ Issue - 5701 ] Mouse down and drag is selecting records, while file import modal is open (#5716)
## Changes Made - Prevent mouse event propagation outside modal - Prevent text selection inside the modal during drag event ## Related Issue https://github.com/twentyhq/twenty/issues/5701 ## Evidence ### Before https://github.com/twentyhq/twenty/assets/87609792/c15c2a1d-5e3b-4fc5-a98a-638615e8d7b9 ### After Actual drag operation is done, but not visible in the video https://github.com/twentyhq/twenty/assets/87609792/f2e68e67-1eb1-4a15-83c8-8cb4313bcaa1 --------- Co-authored-by: Thomas Trompette <thomas.trompette@sfr.fr>
This commit is contained in:
committed by
GitHub
parent
fa70f9cfc7
commit
ce1469cf0c
@@ -82,6 +82,7 @@ const StyledBackDrop = styled(motion.div)`
|
|||||||
top: 0;
|
top: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
|
user-select: none;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -141,8 +142,12 @@ export const ModalLayout = ({
|
|||||||
modalRef,
|
modalRef,
|
||||||
className,
|
className,
|
||||||
}: ModalLayoutProps) => {
|
}: ModalLayoutProps) => {
|
||||||
|
const stopEventPropagation = (e: React.MouseEvent) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledBackDrop>
|
<StyledBackDrop onMouseDown={stopEventPropagation}>
|
||||||
<StyledModalDiv
|
<StyledModalDiv
|
||||||
// framer-motion seems to have typing problems with refs
|
// framer-motion seems to have typing problems with refs
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
|||||||
Reference in New Issue
Block a user