Skip to content

Conversation

@hugovandevliert
Copy link
Contributor

When a user starts a drag operation inside the modal (e.g., selecting text in an input field) and their mouse moves outside the modal boundary, the modal closes unexpectedly when they release the mouse button.

This happens because the browser fires a click event on the backdrop even when mousedown started inside the modal content.

This fix checks if text is currently selected before closing. If the user has an active text selection, the modal stays open.

Fixes #278

When a user starts a drag operation inside the modal (e.g., selecting
text in an input field) and their mouse moves outside the modal
boundary, the modal closes unexpectedly when they release the mouse
button.

This happens because the browser fires a click event on the backdrop
even when mousedown started inside the modal content.

This fix checks if text is currently selected before closing. If the
user has an active text selection, the modal stays open.

Fixes excid3#278
@hugovandevliert hugovandevliert marked this pull request as ready for review December 23, 2025 12:31
@excid3 excid3 merged commit b5d507e into excid3:main Dec 23, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mouse click that started inside modal should not close modal

2 participants