Skip to content

Commit

Permalink
[ Fix ] [ Issue - 5701 ] Mouse down and drag is selecting records, wh…
Browse files Browse the repository at this point in the history
…ile file import modal is open (twentyhq#5716)

## Changes Made

- Prevent mouse event propagation outside modal 
- Prevent text selection inside the modal during drag event

## Related Issue

twentyhq#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 <[email protected]>
  • Loading branch information
Anand-Krishnan-M-J and thomtrp authored Jun 4, 2024
1 parent 49530ca commit 4901636
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const StyledBackDrop = styled(motion.div)`
top: 0;
width: 100%;
z-index: 9999;
user-select: none;
`;

/**
Expand Down Expand Up @@ -141,8 +142,12 @@ export const ModalLayout = ({
modalRef,
className,
}: ModalLayoutProps) => {
const stopEventPropagation = (e: React.MouseEvent) => {
e.stopPropagation();
};

return (
<StyledBackDrop>
<StyledBackDrop onMouseDown={stopEventPropagation}>
<StyledModalDiv
// framer-motion seems to have typing problems with refs
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
Expand Down

0 comments on commit 4901636

Please sign in to comment.