react-native-safe-area-context icon indicating copy to clipboard operation
react-native-safe-area-context copied to clipboard

initialWindowSafeAreaInsets in v3 reports different bottom than initialWindowMetrics in v0.7 (Android)

Open fritzfr opened this issue 5 years ago • 1 comments

I just updagraded from 0.7.3 to the latest v3.

I replaced initialWindowMetrics.bottom with initialWindowSafeAreaInsets.insets.bottom.

While this should be 0 (and was in v0.7.3), I am now getting 34 on the Nexus Android Simulator.

fritzfr avatar Jul 08 '20 11:07 fritzfr

As far as I could see in the code, initialWindowSafeAreaInsets is declared to be:

export const initialWindowSafeAreaInsets = initialWindowMetrics?.insets;

And it should be the same, but I believe that this has to do with a certain delay to update the value correctly in initialWindowMetrics and then this value is not propagated to initialWindowSafeAreaInsets, making it not have the updated values.

Note: This is just a theory that can help in finding a solution to this problem. And for now exchanging initialWindowSafeAreaInsets for initialWindowMetrics solves the problem!

Gabrielfcs avatar Jan 13 '21 18:01 Gabrielfcs

This is for v3 of the library, and we're on v4. Please re-open a new issue if you're still facing issues

jacobp100 avatar Jan 19 '23 16:01 jacobp100