-
Notifications
You must be signed in to change notification settings - Fork 904
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
close
and cancel
events for dialog and snackbar
#1583
Labels
Type: Feature
New feature or request
Comments
9 tasks
9 tasks
copybara-service bot
pushed a commit
that referenced
this issue
Jun 26, 2023
fixes #1583 PiperOrigin-RevId: 543535752
copybara-service bot
pushed a commit
that referenced
this issue
Jun 26, 2023
fixes #1583 PiperOrigin-RevId: 543535752
copybara-service bot
pushed a commit
that referenced
this issue
Jun 27, 2023
fixes #1583 PiperOrigin-RevId: 543535752
copybara-service bot
pushed a commit
that referenced
this issue
Jun 27, 2023
fixes #1583 PiperOrigin-RevId: 543535752
forwent close in favor of closing + closed, and don't know how it will interact with the dialog interaction model. Though re-dispatched the cancel event |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
Consider the case of a
<pwa-update>
element, which defines a UI for the popular "click to update" pattern in PWAsThe authors of
<pwa-update>
would like to give users flexibility to put any dialog implementation in thenotifyer
slot, including<mwc-dialog>
and<mwc-snackbar>
By adopting the standard interface of
<dialog>
, in addition to the custom APIs already present, users could more easily use the material components as drop-in replacements.HTMLDialogElement
firesclose
andcancel
events depending on how it was interacted with.Dialog
andSnackbar
, however, fireclosing
andclosed
events. By implementing theclose
andcancel
events as well,Dialog
andSnackbar
could function as drop-in replacements forHTMLDialogElement
.Describe the solution you'd like
Dialog and Snackbar should implement
close
andcancel
events in addition to the existingclosing
andclosed
events. It's open to discussion when in the lifecycleclose
andcancel
should fire. An initial intuition suggests after non-default-preventedclosing
and beforeclosed
.Describe alternatives you've considered
Our aforementioned
<pwa-update>
authors would likely expose a JavaScript API to their element as an escape hatch, and for gluing in non-standard custom-elements, however, we'd prefer a "just works" composable solution using standard, class-agnostic interfaces.Users could also write their own wrappers
But that seems to my mind a bit of a reach
Additional context
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog
https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement
The text was updated successfully, but these errors were encountered: