Skip to content

[Android] KeyboardAwareScrollView causes content to disappear #3640

@iankberry

Description

@iankberry

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 fitToContents detent
  • A large amount of content exceeding the screen height
  • A KeyboardAwareScrollView (from react-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

  1. Clone the demo repo
  2. Run yarn install
  3. Run yarn android
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Platform: AndroidThis issue is specific to AndroidRepro providedA reproduction with a snack or repo is provided

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions