I got strange issue with modal while working, here is a issue description:
I am using version 0.35 react-native. Please help.
I got the same issue. I figured out that mounting/unmounting any View with position: absolute will make the view above it - I mean right above in the code - vanish.
A temporary solution is to put the View with position: absolute at start of the children :
Change this:
<View>
<View>...</View>
<View style={{ position: 'absolute' }}>Hey !</View>
</View>
By this:
<View>
<View style={{ position: 'absolute' }}>Hey !</View>
<View>...</View>
</View>
I found a workaround, just put the absolute positioned element twice, one on top of the other. Then you don't notice if one disappears
BTW this is not just a problem with Modal, I made my own JS Modal and the problem stays so I think it must be to do with stacking of absolute positioned views
The same behavior happens with me too, but no one of those workarounds fixes this behavior to me. I using the 0.42.0-rc.3
On 0.42
Fix that helped me with disappearing components: setting zIndex to it
Another one, which removed disappearing screen problem using custom self-written Modal
Rendering modal with position: 'absolute' before content (instead of after) fixed for me
return (
<View style={{ flex: 1 }}>
+ {this.renderTooltip()}
{children(passedProps)}
- {this.renderTooltip()}
</View>
);
}
you're a lifesaver, @ColCh !
Adding zIndex helps me too, but sadly this is still happening on react native 0.44.0
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!
If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.
Most helpful comment
On
0.42Fix that helped me with disappearing components: setting
zIndexto itAnother one, which removed disappearing screen problem using custom self-written Modal
Rendering modal with
position: 'absolute'before content (instead of after) fixed for me