th3rdwave / react-native-safe-area-context

A flexible way to handle safe area insets in JS. Also works on Android and Web!
MIT License
2.08k stars 191 forks source link

fix: added run recalculation for safe_area when window did become visible #480

Closed ruslan-deyarov closed 2 months ago

ruslan-deyarov commented 3 months ago

Added run recalculation for safe_area when window did become visible

Summary

We found missed scenario when we have to run recalculation for safe_area. In case we open before native modal and then put our app into background mode. After restore it from background and close this modal we see old values for safe_area. We need to run recalculation to cover this scenario.

Native modal partially cover screen and in this case safe_area is reduced a little bit by iOS.

Screenshot 2024-03-08 at 15 32 09
jacobp100 commented 3 months ago

Do you have a reproduction here?

ruslan-deyarov commented 3 months ago

Do you have a reproduction here?

Yes, let me attach video.

ruslan-deyarov commented 3 months ago

Wrong safe_area size after background and closing native modal on top.

https://github.com/th3rdwave/react-native-safe-area-context/assets/109741896/c0d5c2fa-9aaa-405b-92cb-eb4625b25d9d

janicduplessis commented 2 months ago

Thanks, sorry about the delay merging this!