-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zIndex is broken across ScrollViews #23614
Comments
Can you run If you believe this information is irrelevant to the reported issue, you may write |
It looks like you are using an older version of React Native. Please update to the latest release, v0.58 and verify if the issue still exists. The "Resolution: Old Version" label will be removed automatically once you edit your original post with the results of running |
See #23615 (comment) |
Yeah I think the fact that green renders on top at all is the bug, unfortunately... |
@acb Why did you close this? I'm experiencing this issue too. |
I'm experiencing this issue too. |
@tmaly1980 I guess this can be re-opened -- it's pretty similar to #23615, which has a snack that's an easier reproduction. Personally I gave up on doing what I was trying to do with z-index and found another approach so I haven't been following these cases at all. |
@acb I can't speak for others still experiencing this issue, but I was able to fix my issue by applying zIndex to both sibling and shared ancestor components. |
@tmaly1980 |
scrollview is not working for me too on android. it works on ios. |
any fixes/ alternatives or workaround for this? How were you able to fix this?
|
for me it works in in scrollView i provide in contentContainerStyle={{flex:1}}. |
@aditya1711 |
I am unable to completely understand what you said, but I think you can have different flex values for both scroll views. But I doubt zIndex works as expected with siblings of different parents. Please try it out and let us know. I also will be prepare a better implementation of my functionality if that works. |
<ScrollView style={{ zIndex: 3}} /> can you close? I tested on android https://snack.expo.io/@fabrizio.bertoglio/supportive-graham-crackers |
@fabriziobertoglio1987 |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
RN 0.62.2 |
same issue |
Scrollview with zIndex, and position absolute works someitmes and fails sometimes, still facing this issue. |
same issue |
🐛 Bug Report
zIndex is broken when you have a ScrollView between your two different zIndexes. For example, given code like
you get a view that makes sense, blue background, then red box, then green box on top.
However, if you just switch the container of the green box to a ScrollView, the zIndex breaks:
Expected Behavior
Components inside of a ScrollView should still respect zIndex.
Code Example
Environment
Environment:
OS: Windows 10
Node: 9.3.0
Yarn: 1.3.2
npm: 4.6.1
Watchman: Not Found
Xcode: N/A
Android Studio: Version 3.2.0.0 AI-181.5540.7.32.5056338
Packages: (wanted => installed)
react: 16.3.2 => 16.3.2
react-native: ^0.55.4 => 0.55.4
It's worth noting that on iOS not even the working example I give here works, it doesn't show the green box above the red one ever.
The text was updated successfully, but these errors were encountered: