[iOS] Native Stack layout shift, initial render doesn't take header into account #1779
Labels
Platform: iOS
This issue is specific to iOS
Repro provided
A reproduction with a snack or repo is provided
Description
On initial render the View within a Native Stack has an incorrect height. Upon a second render the height is corrected by taking the header into account. This causes a layout jump/shift which becomes noticable if you are vertically centering your content. Sometimes rendering happens so fast that you don't see it but in other cases it's noticable.
Caused by
vc.edgesForExtendedLayout = UIRectEdgeNone;
being applied after the first render.(introduced by: https://github.com/software-mansion/react-native-screens/pull/222/files)
On for e.g. an iPhone 14 Pro the initial height is 773, which becomes 675.3333129882812 after taking into account "UIRectEdgeNone".
Expected behavior: no layout shift. The View should directly get a correct height or only be shown after the corrected height was calculated.
Steps to reproduce
Snack or a link to a repository
https://snack.expo.dev/zxQpf-O7e?platform=ios
Screens version
3.20.0
React Native version
0.71.6
Platforms
iOS
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Paper (Old Architecture)
Build type
Debug mode
Device
iOS simulator
Device model
iPhone 14 Pro
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: