question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iOS: Whiles a Modal is open, first Alert Dialog or ActionSheet shows underneath Modal

See original GitHub issue

Environment

Environment:
  OS: macOS High Sierra 10.13.3
  Node: 8.9.4
  Yarn: 1.2.1
  npm: 5.6.0
  Watchman: 4.9.0
  Xcode: Xcode 9.3 Build version 9E145
  Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
  expo: ^25.0.0 => 25.0.0
  react: ^16.2.0 => 16.2.0
  react-native: https://github.com/expo/react-native/archive/sdk-25.0.0.tar.gz => 0.52.0

Diagnostics report:
  https://exp-xde-diagnostics.s3.amazonaws.com/trevorkirpaul-5de24453-f1c5-411c-bbcd-8afe85a8e25b.tar.gz

Target Platform: iOS

Steps to Reproduce

iOS device or iOS simulator only

  1. Open a modal
  2. Open an alert
  3. First alert shows up underneath the modal. All of the following alerts show up as intended, in front of the modal. This issue also happened with actionSheets. That first ‘orphan’ alert will linger behind after the modal is closed.

Expected Behavior

I expect the first modal or actionSheet to be visible and in front of the modal. I also expect it to not linger behind when the modal is closed.

Actual Behavior

First alert that fires will pop up underneath the modal. Following alerts will show up as intended, in front of the modal.

This issue also happens with actionSheets.

Reproducible Demo

Published project Repo

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:8
  • Comments:21 (6 by maintainers)

github_iconTop GitHub Comments

7reactions
brentvatnecommented, Apr 6, 2018

Hi people!

You can use the Expo Modal API instead of the React Native one, 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
5reactions
trevor-atlascommented, Apr 6, 2018

This issue also happens with ImagePicker.launchImageLibraryAsync() and ImagePicker.launchCameraAsync() and occurs with the react-native Modal and https://github.com/react-native-community/react-native-modal which is a commonly suggested replacement

Read more comments on GitHub >

github_iconTop Results From Across the Web

iOS 14 (SwiftUI) Sheet Modals not … | Apple Developer Forums
Sometimes a modal is automatically (non-desired) closed right after it opens, and after that, the modal works fine (and so it is not...
Read more >
Showing alert in modal view - Stack Overflow
I got it. It wasn't a problem with modal views. The alert gets blocked because the main thread is executing the web service....
Read more >
ActionSheetIOS / Alert appear behind Modal - #22 by notbrent
Hello, When I have a Modal open and make calls to Alert or ActionSheetIOS, nothing appears until I close the modal. Then they...
Read more >
JavaScript - Bootstrap
Multiple open modals not supported. Be sure not to open a modal while another is still visible. Showing more than one modal at...
Read more >
View Controller Presentation Changes in iOS 13
Default Modal Presentation Style Change ... The default presentation is now page sheet, not full screen. The header documentation for modalPresentationStyle says:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found