Skip to content
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

Fix ActionSheet completion callback not called when dialog is dismissed #26902

Closed
wants to merge 1 commit into from

Conversation

mzehngut
Copy link

Summary

#26429 introduced this problem: when the action sheet is dismissed without having selected and then canceled an action, neither of the success or failure callbacks is called. This causes the Promise that opens the action sheet in the Javascript code to remain unfulfilled. This fix checks that if no activity was chosen, in other words the dismiss button on the share dialog was pressed and the dialog was closed, then the success callback will still be called.

Changelog

[iOS] [Fixed] - Fix ActionSheet completion callback not called when dialog is dismissed

Test Plan

I'm using the react-native-share component to invoke the action sheet. Add these lines to the Javascript code:
import Share from 'react-native-share';
Share.open({
url: 'http://www.facebook.com'
}).finally(() => {
console.log('finally called');
});

In the ActionSheet dialog, press the dismiss button without having selected an action. Without this fix, the finally function is not called. With the fix, it is called. All other behavior is the same as before.

@facebook-github-bot
Copy link
Contributor

Hi mzehngut! Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@react-native-bot react-native-bot added Bug Platform: iOS iOS applications. labels Oct 17, 2019
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 17, 2019
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@mzehngut
Copy link
Author

Sorry, just noticed this problem has already been reported and fixed in #26842.

@mzehngut mzehngut closed this Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Platform: iOS iOS applications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants