zIndex bug for absolute view
See original GitHub issueBefore I used the libary I could do in my scene:
<View>
<View style={{position: 'absolute', zIndex: 20}}>
<Autocomplete />
</View>
<Flatlist/>
</View>
The autocomplete can open above the list. now what happens is that the Flatlist is always above the Autocomplete view. if I swap the order of the components its works fine. (but in RN view it should be fine to use the zIndex as above)
Any idea why it happens? both iOS and Android so I guess it’s not related to something native.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
z-index not working with position absolute - Stack Overflow
I faced this issue a lot when using position: absolute; , I faced this issue by using position: relative in the child element....
Read more >4 reasons your z-index isn't working (and how to fix it)
Z-index is a CSS property that allows you to position elements in layers on top of one another. It's super useful, and honestly...
Read more >Why your z-index isn't working - DEV Community
By default, every element has a position of static. z-index only works on positioned elements (relative, absolute, fixed, sticky) so if you set ......
Read more >zIndex + position:'absolute' breaks with dynamic components ...
When using any kind of zIndex value with position:'absolute', dynamic components (views in an array for example), will fall out of place or...
Read more >Fixes for CSS z-index not working - Weekend Projects
A common issue when design web layouts is making sure one element appears in front or behind another element. One way to stack...
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 Free
Top 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
Hey @melkayam92 while working on something else I worked out what was wrong. The
SceneView
java class has to inherit fromReactViewGroup
(instead ofViewGroup
) to get the zIndex working. I’ve just released the fix in navigation-react-native v8.1.1I see.
I will check it in my real use case and let you know.