How to detect Alert close/dismiss when user clicks on backdrop

I need to transition to a different page once the alert has been dismissed. If it’s a button click I can use alert.dismiss().then() but what about clicks on the backdrop? Is there someway to get an “onDismiss” event or something to that effect?

Did you ever figure this out? I also need to know if the user tapped the physical back button on Android.

Ok guys n/or girls ! Finally found the solutions :stuck_out_tongue:
You need to set a button with a “cancel” role and the handler attached to this button will also be fired when the backdrop is clicked.

1 Like