Modal covers Views despite hierarchy
See original GitHub issueI’ve got a loading spinner in a container view which is at the bottom of the view hierarchy (so it should be furthest forward). But when the modal comes up, it covers this loading view. I’m pretty sure that this wasn’t the case in an earlier version. Is there any way to fix this? Pictures below:
The loading view has the following style, and since it’s below the Modal in the View hierarchy, it should be infront of the Modal:
{
position: 'absolute',
flexDirection: 'column',
justifyContent: 'flex-end',
top: 0.5 * Dimensions.get('window').height - 75,
right: 0.5 *Dimensions.get('window').width - 75,
height: 150,
width: 150,
backgroundColor: '#2F3138',
opacity: 0.8,
borderRadius: 10,
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Bring View on top of Modal using zIndex style with React-Native
You have to swap them. The greater is the z-index , the "higher" the element is in the view hierarchy. Try to put...
Read more >Best Practices for Modals / Overlays / Dialog Windows
Sizing & Location. A modal window should not be too big or too small, you want it juuuuust right. The goal is to...
Read more >Presenting a View Controller - Apple Developer
If the presenting view controller does not cover the screen, UIKit walks up the view controller hierarchy until it finds one that does....
Read more >Taxonomy Hierarchy Management UI Pattern
The issue with this approach is that the user does not have a full view of the hierarchy, and making simple changes will...
Read more >Modal design pattern
Modal windows interrupt users and force them into doing a specific action. Arguably, in most cases, there is no need to force users...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@gustaver after more digging I found a propType in here that is called ‘coverScreen’. As I said before Android was showing up over everything in the hierarchy and iOS was not(I wanted my modal over everything). I added “coverScreen={true}” and boom iOS modal was covering my screen. It’s possible that “coverScreen” might be automatically setting that prop for Android.
@gustaver Are you trying to do this on Android or iOS? I have a similar setup and my Android version is ignoring the hierarchy, but iOS is not. I know this is not a solution, but I wanted to see if it could be an OS thing.