-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AlertDialog is dismissed when clicking on the dialog #2581
Comments
Thanks for the proposal. I will discuss it with our team. |
Clicking outside of the dialog to close it might be a behavior inherited from Android, but it seems sensible. Having a dialog accidentally close by clicking on it doesn't. Currently, onDismissRequest is unusable to me. I've imported the AlertDialog from material3 and added my above change since there is currently no AlertDialog in material3. |
Thanks. We will discuss it. |
@dima-avdeev-jb This seems to be fixed, no? Should we close the ticket? |
I can confirm this is fixed in 1.3.1, so I'm closing it. Thanks. |
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks. |
The background
Box
fromAlertDialog
registers gestures from the content of the dialog and closes the dialog on clicks both inside and outside of the dialog.Adding a
Modifier.onClick {}
to theSurface
should fix it: https://github.com/JetBrains/androidx/blob/jb-main/compose/material/material/src/desktopMain/kotlin/androidx/compose/material/DesktopAlertDialog.desktop.kt#L229Perhaps that a better way, but that one works for me.
The text was updated successfully, but these errors were encountered: