ionic-framework
ionic-framework copied to clipboard
feat: Alert handler should support a Promise
Prerequisites
- [X] I have read the Contributing Guidelines.
- [X] I agree to follow the Code of Conduct.
- [X] I have searched for existing issues that already include this feature request, without success.
Describe the Feature Request
Many of the existing overlays already support a Promise
to be used with the handler
to control when the overlay dismisses. This is not available to ion-alert
.
This feature request is to add support to ion-alert
to allow for a promise.
Describe the Use Case
Performing an action in the handler callback that requires asynchronous behavior (performing an API call, waiting for user input, waiting a set duration).
Describe Preferred Solution
handler: async() => {
const res = await this.someService.method(); // res returns `true` or `false` controlling if the alert dismisses
return res;
}
Describe Alternatives
No response
Related Code
No response
Additional Information
Split from PR #22518
This issue has been labeled as help wanted
. This label is added to issues that we believe would be good for contributors.
If you'd like to work on this issue, please comment here letting us know that you would like to submit a pull request for it. This helps us to keep track of the pull request and make sure there isn't duplicated effort.
For a guide on how to create a pull request and test this project locally to see your changes, see our contributing documentation.
Thank you!
This feature is completed and will be available in 6.3.0. This feature request will auto close once it is merged and released. Thanks Hans for the assist!
Closing as it is completed via https://github.com/ionic-team/ionic-framework/pull/25702. Only PRs that get merged into the default branch cause issues to autoclose it seems.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.