[0.45+] Changing zIndex dynamically not working on Android
See original GitHub issueIs this a bug report?
Yes
Have you read the Bugs section of the Contributing to React Native Guide?
Yes
Environment
react-native -v
:
react-native-cli: 2.0.1
react-native: 0.46.0
-
node -v
:v8.1.3
-
npm -v
:5.0.3
-
yarn --version
:0.27.5
-
Target Platform: both
-
Development Operating System: macOS Sierra
-
Build tools: both
Steps to Reproduce
In RN 0.44, I can dynamically change zIndex
layout prop for Views on both Android & iOS. But after upgrading to 0.46, only iOS can work as expected, can’t make it work on Android.
Expected Behavior
zIndex
could be changed dynamically on Android.
Actual Behavior
Here are screenshot on Android. By tapping on “Change top box” button, it’s expected that red box will overlap green & blue boxes, another tap should make green box overlap the others, and so on. This works on iOS, but not on Android.
Reproducible Demo
Please see this gist.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:25 (1 by maintainers)
Top Results From Across the Web
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 >JS-zIndex: Can't change z-index of element dynamically
You should create 2 CSS classes, one called focus and one called unfocus. When you click on your element, you should swap the...
Read more >4 reasons your z-index isn't working (and how to fix it)
The solution to this is to set position: relative and explicitly set z-index on at least the white block. You could go one...
Read more >Change z-index dynamically using Javascript - CodePen
You can use the CSS from another Pen by using its URL and the proper URL extension.
Read more >How To Use Zindex In React-Native - ADocLib
To sum up, most issues with z-index can be solved by following these two guidelines: Check that the elements have their position set...
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
I have this problem on 0.45.1 and 0.46.4. I set zIndex of 100, position absolute. It work fine in iOS but not android.
hack style: {elevation:0.01,zIndex:999}