Skip to content

Fixes dialog closing unexpectedly - #286

Open
pkleineb wants to merge 1 commit into
DioxusLabs:mainfrom
Torvex-UG:fix/dialog_closes_unexpectedly
Open

Fixes dialog closing unexpectedly#286
pkleineb wants to merge 1 commit into
DioxusLabs:mainfrom
Torvex-UG:fix/dialog_closes_unexpectedly

Conversation

@pkleineb

Copy link
Copy Markdown

In the newer versions of dioxus-primitives, dialogs would close when clicking on their internal content such as text and empty space. This PR aims to fix this by using the internal dioxus event implementation instead of javascript. Specifically I removed use_outside_dismiss in the DialogContent and replaced it with an onclick handler on the DialogRoot backdrop.

If this implementation doesn't cover all of use_outside_dismiss's features I'll be happy to add them.

@mroetsc
mroetsc force-pushed the fix/dialog_closes_unexpectedly branch 2 times, most recently from 7457ed4 to bf007c1 Compare July 22, 2026 15:03
this switches from use_outside_dismiss javascript function to dioxus
owned event stack
@ealmloff

ealmloff commented Sep 8, 2026

Copy link
Copy Markdown
Member

Can you share a reproduction for the issues you were running into with the current implementation? I cannot get the dialog on the component demo to close when clicking on the dialog content on chrome, safari, or firefox. While this fix does work with the current way the component is laid out, we use this hook elsewhere where a similar fix is not applicable, so I would like to fix the general problem if we can

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.

2 participants