You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to hookup an event handler to close a modal dialog when the user clicks on the backdrop.
I see that click events for the backdrop are forwarded to the dialog element, but if I add a click handler here it will also cause the dialog to close if I click on the dialog itself.
Is there a way to distinguish between a click event on the dialog itself versus the backdrop?
The text was updated successfully, but these errors were encountered:
I know this is an old bug, but I suspect the right way to do this is to add a wrapping div to your dialog. If you get an event on that, it's on the dialog: if you get something on the dialog, it's on the backdrop.
This matches the spec, where there's literally no way to tell them apart. The polyfill is hiding the fact that the backdrop is a real element.
I'd like to hookup an event handler to close a modal dialog when the user clicks on the backdrop.
I see that click events for the backdrop are forwarded to the dialog element, but if I add a click handler here it will also cause the dialog to close if I click on the dialog itself.
Is there a way to distinguish between a click event on the dialog itself versus the backdrop?
The text was updated successfully, but these errors were encountered: