react-native-safe-area-context
react-native-safe-area-context copied to clipboard
Margin mode on iOS can sometimes get stuck with invalid safe area insets
I had something like the following,
<SafeAreaView
style={{ position: 'absolute', left: 0 }}
edges="left"
mode="margin"
/>
When I rotate to landscape and back to portrait, it gets stuck with the landscape insets
I suspect this is because iOS's safeArea prop does not change if you're outside the safe area insets - which you will be going from landscape to portrait. Maybe we should check if the safeArea changed in onLayout
@janicduplessis I think this could be fixed by emitting an NSNotification
from RNCSafeAreaProvider
, and having the views subscribe to that (with id:_providerView
)
Would you accept a PR with this change?