-
-
Notifications
You must be signed in to change notification settings - Fork 216
SafeAreaView rendering children under unsafe area #595
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
Comments
You're not importing |
Sorry for that, yeah it was a typo, i edited the example and got the same behavior |
What happens if you change the |
Yeah i just tried adding a parent view and got the same result |
I can see the issue in the expo snack you provided. I suspect there's some dodgy interaction with reanimated that's breaking the layout and stopping the padding being applied to the SafeAreaView. I'm not 100% sure it's this side - as far as I'm aware we're doing everything correctly I'll leave this issue open in case it is our side - but to set some expectations, I don't think it will get looked at. You're welcome to have an attempt at debugging it, we're good at merging PRs people send us |
I just created issue on Reanimated repository. |
We have noticed something similar happening for our app without using a reanimated View directly. It seems to happen randomly and reinstalling the app fixes it. We have a nested SafeAreaView where the top edge of the child doesn't get applied. Something like this:
I'm have been able to replicate it once locally on a simulator (iPhone 15 Pro - iOS 17.2), and by replacing the inner SafeAreaView with paddings from useSafeAreaInsets fixes it. I'm sorry for being a bit vague but the issue seems to have come out of thin air. |
Description
SafeAreaView from doesn't respect safe areas on iOS when used alongside an animated view with {translateY: 0} in the same screen.
Using a basic view and padding it with insets from useSafeAreaInsets seems to work normally.
This was originally reported here: kirillzyusko/react-native-keyboard-controller#809
Steps to reproduce
Snack or a link to a repository
https://snack.expo.dev/@rodsar/safeareaview-issue
Safe Area Context version
5.2.0
React Native version
0.76
Platforms
iOS
Architecture
None
Build type
None
Device
iOS simulator
Device model
No response
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: