react / react/react-native

[ScrollView] Large text content is not scrollable with hardware keyboard in iOS(repro provided)

未关闭
#52,833 8 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

API: Keyboard Component: ScrollView Issue: Author Provided Repro Platform: iOS Type: Enhancement
主要语言
C++
星标
127k
派生
25.3k
平均合并
1 天 23 小时
30 天内合并 PR
4

描述

Description

This issue is only observed on iOS.

When the content of the ScrollView is large enough to become scrollable and there are no focusable elements inside of it like buttons or form fields, the user can't scroll the content via hardware keyboard's up and down arrow keys.

I've found this as well which might be useful -> https://developer.apple.com/documentation/UIKit/UIScrollView/allowsKeyboardScrolling

Steps to reproduce
  1. Clone the repro.
  2. Install dependencies.
  3. Run iOS with npm run ios or yarn ios
  4. Go to simulator Settings, Accessibility, Keyboards & Typing, Full Keyboard Access, switch to ON.
  5. Go to ReproducerApp.
  6. Try to scroll the content with Hardware Keyboard's up and down arrow keys and observe that nothing is happening.
React Native Version

0.79.4

Affected Platforms

Runtime - iOS

Output of npx @react-native-community/cli info
System:
  OS: macOS 15.5
  CPU: (10) arm64 Apple M1 Max
  Memory: 418.52 MB / 64.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.20.5
    path: ~/.nvm/versions/node/v18.20.5/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.nvm/versions/node/v18.20.5/bin/yarn
  npm:
    version: 10.8.2
    path: ~/.nvm/versions/node/v18.20.5/bin/npm
  Watchman:
    version: 2025.07.21.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/lib/ruby/gems/3.1.0/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.5
      - iOS 18.5
      - macOS 15.5
      - tvOS 18.5
      - visionOS 2.5
      - watchOS 11.5
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23726.103.2422.13016713
  Xcode:
    version: 16.4/16F6
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby:
    version: 3.1.6
    path: /opt/homebrew/opt/ruby@3.1/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 19.1.1
    wanted: 19.1.1
  react:
    installed: 19.1.0
    wanted: 19.1.0
  react-native:
    installed: 0.79.4
    wanted: 0.79.4
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true
Stacktrace or Logs
No crash.
MANDATORY Reproducer

https://github.com/filip-angelov/reproducer-scroll-view-issue

Screenshots and Videos

No response

贡献指南

打开贡献指南

从这里开始

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

调研方向

从链接的复现用例开始,并使用 npm run iosyarn ios 运行它;在模拟器中启用 Full Keyboard Access,并确认方向键失效。阅读 React Native ScrollView 的 iOS 路径,同时参阅 UIKit 关于 UIScrollView.allowsKeyboardScrolling 的文档。完成标准是:没有可聚焦子元素的大型 ScrollView 内容可以使用硬件键盘的上、下方向键滚动。

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

评估

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

把新 issue 发到你的邮箱

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