Merge pull request #423 from chrisvel/fix-dialog-hide
Fix modal closing when dragging content
This commit is contained in:
commit
1d1d07059c
2 changed files with 6 additions and 3 deletions
|
|
@ -439,8 +439,9 @@ const ProjectModal: React.FC<ProjectModalProps> = ({
|
|||
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();
|
||||
|
|
|
|||
|
|
@ -461,8 +461,9 @@ const TaskModal: React.FC<TaskModalProps> = ({
|
|||
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<TaskModalProps> = ({
|
|||
>
|
||||
<div
|
||||
className="h-full flex items-start justify-center sm:px-4 sm:py-4"
|
||||
onClick={(e) => {
|
||||
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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue