ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

feat: Alert handler should support a Promise

Open sean-perkins opened this issue 1 year ago • 2 comments

Prerequisites

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

sean-perkins avatar Aug 01 '22 20:08 sean-perkins

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!

ionitron-bot[bot] avatar Aug 01 '22 20:08 ionitron-bot[bot]

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!

sean-perkins avatar Aug 03 '22 16:08 sean-perkins

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.

liamdebeasi avatar Aug 15 '22 17:08 liamdebeasi

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.

ionitron-bot[bot] avatar Sep 14 '22 17:09 ionitron-bot[bot]