react / react/react-native

ScrollView doesn't scroll up on new line in TextInput

未关闭
#58,517 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Component: ScrollView Component: TextInput Needs: Triage :mag: Type: New Architecture
主要语言
C++
星标
127k
派生
25.3k
平均合并
1 天 23 小时
30 天内合并 PR
4

描述

Description

When an auto-growing multiline TextInput inside a ScrollView gets a new line, the ScrollView is not scrolled up. Only after inserting another new line or a character the ScrollView scrolls to the appropriate position

Steps to reproduce
  1. Install the repro with npm install
  2. npm run ios
  3. Start typing text with each character in the new line

(See video attached)

React Native Version

0.86.0

Affected Platforms

Runtime - iOS

Areas

Fabric - The New Renderer

Output of npx @react-native-community/cli info
System:
  OS: macOS 26.6.2
  CPU: (11) arm64 Apple M3 Pro
  Memory: 153.44 MB / 18.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 24.18.0
    path: /Users/oleksiibulenok/.nvm/versions/node/v24.18.0/bin/node
  Yarn:
    version: 1.22.22
    path: /Users/oleksiibulenok/.nvm/versions/node/v24.18.0/bin/yarn
  npm:
    version: 11.16.0
    path: /Users/oleksiibulenok/.nvm/versions/node/v24.18.0/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.5
      - iOS 26.5
      - macOS 26.5
      - tvOS 26.5
      - visionOS 26.5
      - watchOS 26.5
  Android SDK:
    API Levels:
      - "34"
      - "35"
      - "36"
    Build Tools:
      - 34.0.0
      - 35.0.0
      - 36.0.0
    System Images:
      - android-35 | Google Play ARM 64 v8a
      - android-36 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2025.1 AI-251.26094.121.2512.13991807
  Xcode:
    version: 26.6/17F113
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.14
    path: /Users/oleksiibulenok/Library/Java/JavaVirtualMachines/jbr-17.0.14/Contents/Home/bin/javac
  Ruby:
    version: 2.7.6
    path: /Users/oleksiibulenok/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.1.0
    wanted: 20.1.0
  react:
    installed: 19.2.3
    wanted: 19.2.3
  react-native:
    installed: 0.86.0
    wanted: 0.86.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true
Stacktrace or Logs
N/A
MANDATORY Reproducer

https://github.com/abulenok/MultilineGrowRepro

Screenshots and Videos

https://github.com/user-attachments/assets/23aacdd2-168d-495e-9e55-f99dc00c2fdb

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先使用 npm install 和 npm run ios 运行强制复现步骤,然后跟踪首次换行所涉及的 iOS Fabric TextInput 和 ScrollView 行为。完成的标准是:自动增长的多行 TextInput 使周围的 ScrollView 在新行出现后立即滚动到适当位置,而不需要再输入字符或换行。

由索引模型根据 Issue 内容生成。

评估

技术栈
ios, react-native
领域
mobile
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。