Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(iOS): invalid orientation of contained modals (#2011)
## Description On iOS there's a bug with contained (and contained transparent) modals, where the modal does not change its orientation when the whole interface (and/or device) is being rotated. That's because contained modals will keep its orientation when the interface is being rotated, as their controllers don't update the bounds -> `viewDidLayoutSubviews` and `updateBounds` methods were not called at the moment of changing the orientation. This PR fixes this bug by updating the bounds when `layoutSubviews` method from RNSScreenStack is being called, meaning that no matter if there were previously any modals that have been dismissed or not, screen stack will always update the bounds of the modal views. Fixes #2006. ## Changes - Fixed the problem with invalid orientation of contained modals by updating their bounds. ## Screenshots / GIFs ### Before https://github.com/software-mansion/react-native-screens/assets/23281839/069a2df7-ebb6-4de5-b8be-d5e1d045421b ### After https://github.com/software-mansion/react-native-screens/assets/23281839/c3cbd102-4c68-4749-b2a0-4eaba6b8703f ## Test code and steps to reproduce You can use Test2008 from TestsExample and FabricTestExample to test the change from this PR. ## Checklist - [X] Included code example that can be used to test this change - [x] Ensured that CI passes
- Loading branch information