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

[iOS] Cannot open image picker after using ModalSelector #154

Open
scousino opened this issue Oct 30, 2020 · 2 comments
Open

[iOS] Cannot open image picker after using ModalSelector #154

scousino opened this issue Oct 30, 2020 · 2 comments

Comments

@scousino
Copy link

On iOS, after using the ModalSelector, you cannot open other modals from different libraries. For example, this package breaks both react-native-image-picker and react-native-image-crop-picker's ability to launch a gallery for selecting images/videos.

My inclination is that maybe this library isn't correctly closing and cleaning up a modal after it has been "closed" via cancel or an option being selected.

This is logged in XCode when trying to call launchImageLibrary, after selecting an option from the modal selector, for react-native-image-picker:
Attempt to present <UIImagePickerController: 0x10b03dc00> on <RCTModalHostViewController: 0x113f8e0f0> (from <RCTModalHostViewController: 0x113f8e0f0>) whose view is not in the window hierarchy.

which is what makes me think react-native-modal-selector is doing something to RCTModalHostViewController

iOS Version: 14.1
React Native version: 0.62.2
react-native-modal-selector: 2.0.2
react-native-image-picker: 3.0.0-vnext.2

@scousino
Copy link
Author

I had to workaround this by manually controlling the visibility of the modal, and only closing it after returning from image/video selection.

@scousino
Copy link
Author

I've also opened an issue with react-native-image-picker here: react-native-image-picker/react-native-image-picker#1456 that has additional information on the setup and usage. Although, since I get the same behavior from 2 different image picker packages I'm thinking this package is the true cause of the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant