Skip to content

[iOS] multiline TextInput in ScrollView scrolls to top of TextInput if when typing overflows to a new line #49226

Open

Description

@ugurakin1

Description

When typing in a multiline TextInput (controlled in this case), the screen scrolls so the entire TextInput is within the view when the text overflows to the next line. Only happens if the user is typing at the end of the text. See the demos below.

Similar to but not quite the same as #48412 and #39660

Steps to reproduce

  1. Have a (controlled, but not sure it matters) multiline TextInput within ScrollView with some lines of text in it
  2. Scroll down so the top of the TextInput is above the viewport
  3. Start typing at the end of the text within the TextInput - when the text overflows to a new line the top of the element will automatically scroll back into the viewport

React Native Version

0.76, 0.74.5

Affected Platforms

Runtime - iOS

Output of npx react-native info

System:
  OS: macOS 14.6.1
  CPU: (12) arm64 Apple M3 Pro
  Memory: 113.59 MB / 18.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.16.0
    path: ~/.nvm/versions/node/v20.16.0/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.8.1
    path: ~/.nvm/versions/node/v20.16.0/bin/npm
  Watchman:
    version: 2024.08.19.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/uakin/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.1
      - iOS 18.1
      - macOS 15.1
      - tvOS 18.1
      - visionOS 2.1
      - watchOS 11.1
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.1 AI-241.18034.62.2411.12169540
  Xcode:
    version: 16.1/16B40
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.12
    path: /usr/bin/javac
  Ruby:
    version: 3.0.7
    path: /Users/uakin/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.5
    wanted: 0.74.5
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

info React Native v0.77.0 is now available (your project is running on v0.74.5).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.77.0
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.74.5
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".

Stacktrace or Logs

N/A

Reproducer

https://snack.expo.dev/hUmMl37uriVOWz7jHP0jW

Screenshots and Videos

Scrolls so the beginning of the element is in view, behaves normally otherwise:

Screen.Recording.2025-02-06.at.14.16.21.mov

Only happens when typing at the end of the text (also adding a new line won't trigger the same behaviour):

Screen.Recording.2025-02-06.at.14.19.08.mov

Even weirder when the TextInput is long enough to cover the entire screen - will scroll to the top and then scroll back to bottom so cursor is within the screen:

Screen.Recording.2025-02-06.at.14.24.37.mov

Activity

  1. react-native-bot commented on Feb 6, 2025

    @react-native-bot
    Collaborator

    Warning

    Unsupported version: It looks like your issue or the example you provided uses an unsupported version of React Native.

    Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.

  2. react-native-bot commented on Feb 6, 2025

    @react-native-bot
    Collaborator

    Warning

    Unsupported version: It looks like your issue or the example you provided uses an unsupported version of React Native.

    Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.

  3. ugurakin1 commented on Feb 6, 2025

    @ugurakin1
    Author

    Can reproduce in an expo snack using v52 so must be happening even in v0.76 and in new arch, correct?

  4. Aitchy13 commented on Mar 26, 2025

    @Aitchy13

    @ugurakin1 did you find a workaround for this? I'm having the same problem. Since it only affects you when you're editing the last line, I'm currently looking to see if I can force a newline to be added to the text input without other side effects

  5. Aitchy13 commented on Mar 26, 2025

    @Aitchy13

    This missing piece for me was setting the scrollEnabled property on the TextInput to true, even though it'll never scroll for me.

  6. Aitchy13 commented on Mar 28, 2025

    @Aitchy13

    In addition, I also had to wrap my TextInput component in it's own ScrollView, then set the ScrollView to scrollEnabled={false} too

  7. MattAgn commented on Jul 22, 2025

    @MattAgn

    I can also reproduce this issue with newArch and latest RN version 79.3

  8. iamnabink commented on Nov 2, 2025

    @iamnabink

    I can reproduce it as well in iOS

  9. react-native-bot commented on May 2, 2026

    @react-native-bot
    Collaborator

    This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

  10. added
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    and removed
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on May 2, 2026
  11. react-native-bot commented on Oct 29, 2026

    @react-native-bot
    Collaborator

    This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

  12. added
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: ScrollViewComponent: TextInputRelated to the TextInput component.FlowNeeds: AttentionIssues where the author has responded to feedback.Platform: iOSiOS applications.StaleThere has been a lack of activity on this issue and it may be closed soon.Type: Unsupported VersionIssues reported to a version of React Native that is no longer supported

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions