fix(modal): DLT-3476 do not close when drag starts inside dialog and ends on backdrop#1322
fix(modal): DLT-3476 do not close when drag starts inside dialog and ends on backdrop#1322Nina Repetto (ninarepetto) wants to merge 1 commit into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited) Review profile: ASSERTIVE Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Please add either the |
|
✔️ Deploy previews ready! |
https://dialpad.atlassian.net/browse/DLT-3476
Obligatory GIF (super important!)
🛠️ Type Of Change
These types will increment the version number on release:
These types will not increment the version number, but will still deploy to documentation site on release:
📖 Jira Ticket
https://dialpad.atlassian.net/browse/DLT-3476
📖 Description
The modal no longer closes when a user starts a click or text selection drag inside the dialog content and releases the mouse on the backdrop. A
mousedownhandler now tracks whether the press originated on the backdrop itself, and theclickhandler only closes the modal when both themousedownand theclicklanded on the backdrop.💡 Context
Previously, the modal closed on any
clickevent whose target was the backdrop overlay, regardless of where the mouse button was first pressed. This meant that dragging to select text inside the modal and releasing outside it would unexpectedly dismiss the dialog. The fix introduces a_mousedownOnBackdropflag: it is set totrueonly whenmousedownfires directly on the backdrop, and theclickhandler gatesclose()on that flag. The flag is initialised tofalseincreated()so it is always in a known state.📝 Checklist
For all PRs:
For all Vue changes:
For all CSS changes:
🔮 Next Steps
None.
📷 Screenshots / GIFs
None needed — this is a logic-only fix with no visual changes.
🔗 Sources