Skip to content

[Android] TextInput inside a scrollView does not scroll to when focused #22951

@asaravi

Description

@asaravi

Environment

  React Native Environment Info:
    System:
      OS: macOS 10.14.2
      CPU: (8) x64 Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz
      Memory: 30.73 MB / 8.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 8.9.4 - /usr/local/bin/node
      Yarn: 1.12.3 - /usr/local/bin/yarn
      npm: 5.6.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
      Android SDK:
        API Levels: 23, 25, 26, 27
        Build Tools: 23.0.1, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.3
        System Images: android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom_64, android-27 | Google Play Intel x86 Atom
    IDEs:
      Android Studio: 3.2 AI-181.5540.7.32.5056338
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.6.1 => 16.6.1
      react-native: 0.57.5 => 0.57.5
    npmGlobalPackages:
      react-native-cli: 2.0.1

Description

Hey Guys,

I've been trying to narrow this down but it doesn't look like I'm getting anywhere. I was hoping that you may have more insight into the situation, or if its simply an android bug waiting to be fixed.

I've noticed that with the below xml, when a TextInput field is focused, the ScrollView container is not focused into. The keyboard does pop up however, and the field is focused, it just doesn't scroll so that the input field is visible.

The basic structure is as below:

<KeyboardAvoidingView>
  <SafeAreaView>
    <ScrollView>
      ...
      <TextInput />
      ...
    <ScrollView>
  </SafeAreaView>
</KeyboardAvoidingView>

The snack below illustrates this as well, where the button up top focuses in to the InputText, but it doesn't scroll.

Please let me know if any more information is required

Reproducible Demo

https://snack.expo.io/HkZimXHfN

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions