OWA-102: fix modal closing behavior #649
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When the modal is open, clicking and holding the mouse button down on any element and then moving the cursor to the overlay to release the mouse button causes the modal to close. This behavior is unintended. The modal should only close if the initial mousedown event originated on the overlay itself.
Acceptance Criteria
Correct Close Behavior
The modal closes only when the initial mousedown event starts on the overlay and the mouseup event is completed on the overlay.
Prevent Unintended Close
If the mousedown event begins on any interactive or non-overlay element within the modal and the cursor is dragged to the overlay before releasing, the modal should not close.
Interaction on Modal Content
All interactions within modal elements (e.g., buttons, text fields, dropdowns) are unaffected, and the modal remains open regardless of cursor movement or mouse button release outside these elements.
Overlay-Specific Closing
The overlay retains its intended functionality: Clicking directly on the overlay (both mousedown and mouseup) closes the modal.
This PR solves OWA-102
Steps completed:
According to our definition of done, I have completed the following steps: