ActionSheetIOS / Alert appear behind Modal

Hello,

When I have a Modal open and make calls to Alert or ActionSheetIOS, nothing appears until I close the modal. Then they will appear. It seems that maybe they are appearing behind the Modal.

This seems to only be an issue in iOS (Android works ok). I have also tested this in plain React Native (not with Expo) and I do NOT see the issue.

How can I get the Alert / ActionSheetIOS to appear when a Modal is open?

Snack below:

https://snack.expo.io/HJIyUi65f

Thank you.

3 Likes

This was working for me correctly until the last expo Client update…

1 Like

Hey guys,

Can either of you create a minimal repro case for this using Snack? That will help us with the debugging process greatly.

Thanks,

Adam

Hey,

try this:

First Alert or ActionSheet opened in modal is shown only after closing modal window.

1 Like

The expo camera also appears behind the modal. (react-native-modal)

I’ve just noticed the same Error on my app :sweat:

Is it only appearing in the last Expo client ? If i build my app, would be it still be like this ?
I haven’t changed my app to Expo SDK 16 nor react-native 0.54 and now i have this issue.

This is definitely odd. @ericmorgan1 when i am testing your snack on ios, the first click on action sheet creates it behind the modal, and the second click creates it in front.

How about using this modal instead: https://github.com/react-native-community/react-native-modal . Does it have the same errors on ios?

Hey @quinlanj
—-
Edit: sorry, I misread that. I have not tried that modal, but I will try it.

What I meant was that this action sheet has the same issue:
https://github.com/expo/react-native-action-sheet

@llecocq Yes, this problem is after updating to the last version of Expo client. It is not the problem of EXPO SDK 26

1 Like

@quinlanj I’ve just tried the modal that you’ve posted here and it has the same errors

Same problem has opening WebBrowser.openBrowserAsync() in the modal window.

Even with FilePicker / PicturePicker

I’m having this issue as well, alerts and actionsheet is showing up behind my modals on the first try. After that, they appear correctly.

After the modal is closed, that first alert/actionsheet lingers on the screen.

I had an old version of Expo on my ipad and this issue was not occurring. After updating to the latest, the issue popped up again.

This is definitely related to the app on iOS. I’m seeing the issue on my ipad, iphone and xcode simulator.

I am not seeing this issue on android, via genymotion.

Even the latest update on the iOS store, 2.4.7 (12hours before this comment), has this issue still.

Just to reiterate, my build was always the same and I was testing a published expo app. Using that same exact published app, I had the issue on the latest version of the iOS expo app on devices and simulators.

1 Like

similar issue here: ImagePicker launchImageLibraryAsync does not float on Modal - #5 by cantide5ga

@adamjnav / @quinlanj / @notbrent

Would it be better to add this as an issue on Github?

Hello Expo Team,
Is there any one working on this problem?
Any ETA on when the fix would be available?

thanks in advance for a great product!

Hi people!

You can use the Expo Modal API instead of the React Native one, 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
3 Likes

I created one earlier here, if you wanna keep up with it: https://github.com/expo/expo/issues/1616

1 Like