Tell us which versions you are using:
Tell us to which platform this issue is related
-> iOS
Click on button in react-native-modal
modal close
imagepicker open
Click on button in react-native-modal
modal close
imagepicker open
imagepicker closes immidietly
modal stays on top of everything
screen is freeze
I'm opening imagepicker from react-native-modal.
After user clicks on the button inside react-native-modal. I want to hide the modal and then open image picker.
If I close modal after closing imagepicker no error occured.
It looks like closing of modal and immediately opening the imagepicker conflicting.
// stacktrace or any other useful debug info
Love react-native-image-crop-picker? Please consider supporting our collective:
馃憠 https://opencollective.com/react-native-image-crop-picker/donate
We had he same problem.
See https://github.com/ivpusic/react-native-image-crop-picker/issues/264.
Basically, before opening the picker form modal, dismiss the modal and wait 200 ms.
There is a bug in RN when both a modal and native Alert dialog are shown
Any update on this issue? Waiting for a predefined time seems pretty hacky.
We had to do something similar, placing some image picker logic behind a setTimeout. Definitely looking to migrate to a different framework.
I had to do some thing solve this problem in iOS.
I got the tag in the react code銆侫nd then remove the view in the iOS code.
And it seem to be works for me.
This problem is only in ios but in android its work properly. So to solve this problem in ios, i need to keep at least 320ms waiting to work in ios.
I did this way.
const wait = new Promise((resolve) => setTimeout(resolve, 320));
Platform.OS === 'ios' ? wait.then(() => kamera()) : kamera();
Using a delay is hackish and doesn't account for custom animation on modals. The proper fix around this is to trigger the imagePicker until after the modal was hidden.
See https://reactnative.dev/docs/modal#ondismiss or onModalHide for https://github.com/react-native-community/react-native-modal
Using a delay is hackish and doesn't account for custom animation on modals. The proper fix around this is to trigger the imagePicker until after the modal was hidden.
See https://reactnative.dev/docs/modal#ondismiss or
onModalHidefor https://github.com/react-native-community/react-native-modal
thx... work for me
Most helpful comment
We had he same problem.
See https://github.com/ivpusic/react-native-image-crop-picker/issues/264.
Basically, before opening the picker form modal, dismiss the modal and wait 200 ms.
There is a bug in RN when both a modal and native Alert dialog are shown