diff --git a/frontend/components/Project/ProjectModal.tsx b/frontend/components/Project/ProjectModal.tsx index d6210b4..db370e5 100644 --- a/frontend/components/Project/ProjectModal.tsx +++ b/frontend/components/Project/ProjectModal.tsx @@ -439,8 +439,9 @@ const ProjectModal: React.FC = ({ className={`fixed top-16 left-0 right-0 bottom-0 flex items-start sm:items-center justify-center bg-gray-900 bg-opacity-80 z-40 transition-opacity duration-300 ${ isClosing ? 'opacity-0' : 'opacity-100' }`} - onClick={(e) => { + onMouseDown={(e) => { // Close modal when clicking on backdrop, but not on the modal content + // Use mousedown instead of onClick to prevent issues with text selection dragging // Also prevent immediate closes after modal opens if (e.target === e.currentTarget && !modalJustOpened) { handleClose(); diff --git a/frontend/components/Task/TaskModal.tsx b/frontend/components/Task/TaskModal.tsx index c02350f..5214358 100644 --- a/frontend/components/Task/TaskModal.tsx +++ b/frontend/components/Task/TaskModal.tsx @@ -461,8 +461,9 @@ const TaskModal: React.FC = ({ className={`fixed top-16 left-0 right-0 bottom-0 bg-gray-900 bg-opacity-80 z-40 transition-opacity duration-300 overflow-hidden sm:overflow-y-auto ${ isClosing ? 'opacity-0' : 'opacity-100' }`} - onClick={(e) => { + onMouseDown={(e) => { // Close modal when clicking on backdrop, but not on the modal content + // Use mousedown instead of onClick to prevent issues with text selection dragging if (e.target === e.currentTarget) { handleClose(); } @@ -470,8 +471,9 @@ const TaskModal: React.FC = ({ >
{ + onMouseDown={(e) => { // Close modal when clicking on centering container, but not on the modal content + // Use mousedown instead of onClick to prevent issues with text selection dragging if (e.target === e.currentTarget) { handleClose(); }