-
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
First element in the tree having position:absolute is invisible until Inspect is toggled #22692
Comments
Tested and confirmed also on:
|
this is expected issue. Please see https://facebook.github.io/react-native/docs/flexbox for layout best practices. |
Wait, what? Why this is expected? I need a proper explaination, the article you've linked doesn't say a word about it. |
opt-in into absolute positioning you're excluding view from normal layout flow, so other views will overdraw it. |
but z-indexes doesn't work as expected then also toggling inspection changes drawing behavior which makes no sense and I am working around this issue by adding empty View, which should render nothing so it also shouldn't cause another drawing behavior |
What would like to achieve with this solution, I think that this solution might not be the best one. |
Environment
React Native Environment Info:
System:
OS: Windows 10
CPU: ia32 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Memory: 1.36 GB / 15.89 GB
Binaries:
Node: 11.2.0 - C:\nodejs\node.EXE
Yarn: 1.12.3 - C:\Apps\Yarn\bin\yarn.CMD
npm: 6.4.1 - C:\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.2.0.0 AI-181.5540.7.32.5056338
Happens on Android 8.1.0, Xiaomi Redmi Note 5 Pro with MIUI 10.0.6.0 Stable, official, with no mods. Not tested on other devices.
Description
Element being "first of siblings" in a tree (more on that later) having
position: absolute
is invisible until Inspect is turned on. It is rendered normally after closing the inspector. Trying to dynamically toggleposition
ortop
properties doesn't help (I tried to force re-render with that).Video: https://www.youtube.com/watch?v=szMEhaDOCxA
Explaination of
first of siblings
:Bug will happen:
Bug won't happen:
Reproducible Demo
Repository:
https://github.com/dzek69/react-native-position-absolute-bug
But the code is quite simple, this is enough to reproduce:
The text was updated successfully, but these errors were encountered: