-
-
Notifications
You must be signed in to change notification settings - Fork 615
Description
Description
This issue requires several different conditions but it is reproducible so I figured it was worth opening an issue for here.
Required conditions:
- Android (issue not present on iOS)
- A sheet with
fitToContentsdetent - A large amount of content exceeding the screen height
- A
KeyboardAwareScrollView(fromreact-native-keyboard-controller) containing an autofocus text input
When these conditions are present, the form sheet fails to open properly as the content "blows out" off screen. Closing and re-opening the keyboard causes the content to appear normally. Disabling autofocus prevents the issue from occurring. As does using a standard RN ScrollView
Admittedly I realize that putting a scroll view inside of a sheet without a fixed parent height could be problematic. But this also feels like something that shouldn't be able to occur. It almost seems like a race condition of some sort with the keyboard appearing at the same time while the initial layout is being calculated.
Another thing to note is that sometimes the issue does not occur on the first attempt after the app is opened. It happens consistently after that though.
Screen.Recording.2026-02-12.at.12.02.05.PM.mov
Steps to reproduce
- Clone the demo repo
- Run
yarn install - Run
yarn android - Tap the 'Open formsheet' button (might have to do this twice)
Snack or a link to a repository
https://github.com/iankberry/android-formsheet-fittocontents-issue
Screens version
4.23.0
React Native version
0.81.5 (Expo 54)
Platforms
Android
JavaScript runtime
None
Workflow
None
Architecture
Fabric (New Architecture)
Build type
Debug mode
Device
Android emulator
Device model
No response
Acknowledgements
Yes