ImagePicker launchImageLibraryAsync does not float on Modal

#1

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

0 Likes

#2

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

0 Likes

#3

snack here: https://snack.expo.io/BJVlwGEjz

0 Likes

#4

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

0 Likes

#5

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.

0 Likes

ActionSheetIOS / Alert appear behind Modal
#6

same topic here ActionSheetIOS / Alert appear behind Modal

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

0 Likes

#7

updated snack to show the same issue with react-native-modal: https://snack.expo.io/@tatlas/modal-bug

0 Likes

#8

hey folks, my bad. you can use an Expo Modal api like this: https://snack.expo.io/ByEqo7Bif

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

closed #9

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

0 Likes