ImagePicker launchImageLibraryAsync does not float on Modal

I used ImagePicker.launchImageLibraryAsync () to access library. In my case, I’m using modal to display information, and button to open library on this modal. When I click on the button, library opened under the modal, I have to close modal to see library.
Please help me solve this issue. In last Expo version, It still works well

I am also experiencing this issue. using a react-native modal with ImagePicker.launchImageLibraryAsync() and ImagePicker.launchCameraAsync() results in the camera or image library opening BEHIND the modal. I’ll get a snack up shortly

snack here: Unnamed Snack - Snack

you should use something like this instead: https://github.com/react-native-community/react-native-modal

we need to either remove the react-native modal component from expo or warn when people use it because this is a common source of confusion due to how it handles stacking views

Hi, glad I found this issue. This describes my issue exactly, and I am actually using react-native-modal. I’ll get a snack up to help troubleshoot.

same topic here ActionSheetIOS / Alert appear behind Modal

@notbrent - react-native-modal has this issue as well

updated snack to show the same issue with react-native-modal: modal bug - Snack

hey folks, my bad. you can use an Expo Modal api like this: Expo Modal - Snack

I’ll work on getting some documentation up shortly. The main differences between the react-native Modal API and this are:

  • you need to use ModalHost at the root of your app, like a Provider. you should also ideally put it inside of any Providers so it has the same context available
  • only the context that is available to the ModalHost is available to Modal
1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.