Skip to content

TextInput inside ScrollView can cause input to look invisible  #25716

@bobjflong

Description

@bobjflong

When a non-scrolling multiline TextInput is inside a ScrollView, certain new lines are invisible. This is possibly limited to iPhone X. I have not been able to reproduce on iPhone 7, for example.

In this gif, I added a bunch of As, until I found an invisible line, where I typed hello. I can move this hello in or out of view by pushing it to the next or previous line:

2019-07-17 17 22 46

React Native version:

info Fetching system and libraries information...
System:
    OS: macOS 10.14.3
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
    Memory: 781.27 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 8.11.3 - ~/.nvm/versions/node/v8.11.3/bin/node
    Yarn: 1.12.1 - /usr/local/bin/yarn
    npm: 5.6.0 - ~/.nvm/versions/node/v8.11.3/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
  IDEs:
    Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.8.6 => 16.8.6 
    react-native: 0.60.4 => 0.60.4 
  npmGlobalPackages:
    eslint-plugin-react-native: 3.7.0

Steps To Reproduce

  1. On an iPhone X, device or simulator..
  2. Add the example code below
  3. Type a bunch of lines into the TextInput

Expected: every new line that is added is visible.

Actual: some of the lines are invisible, and can only be viewed by pushing them onto the previous or next line.

Minimal code to reproduce:

<ScrollView scrollEnabled style={{ marginTop: 100 }}>
  <TextInput multiline placeholder="type here" scrollEnabled={false} />
</ScrollView>

Workarounds:

  • Enabling scrollEnabled on the TextInput
  • Explicitly setting a height on the TextInput (eg. by dynamically measuring the contents)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugComponent: ScrollViewComponent: TextInputRelated to the TextInput component.StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions