TextInput with Large Font Size (>40) Causes Text to Become Invisible on iOS
未关闭
还没有人认领这个 Issue。
Component: TextInput
Issue: Author Provided Repro
Platform: iOS
- 主要语言
- C++
- 星标
- 127k
- 派生
- 25.3k
- 平均合并
- 1 天 23 小时
- 30 天内合并 PR
- 4
描述
Description
When using a TextInput component with a large fontSize (greater than 40), the text becomes invisible on iOS devices. This issue does not occur on Android, where the text is displayed correctly regardless of the font size. The problem is particularly evident when the text is long and the TextInput is set to multiline.
Steps to reproduce
- Create a new React Native project with the latest version.
- Add a TextInput component with multiline set to true.
- Set the fontSize of the TextInput to a value greater than 40.
- Provide a long string as the defaultValue or value for the TextInput.
- Run the app on an iOS device or simulator.
React Native Version
0.74.5
Affected Platforms
Runtime - iOS
Output of npx react-native info
System:
OS: macOS 14.5
CPU: (8) arm64 Apple M2
Memory: 134.08 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 18.17.0
path: ~/.nvm/versions/node/v18.17.0/bin/node
Yarn:
version: 3.6.4
path: /opt/homebrew/bin/yarn
npm:
version: 9.6.7
path: ~/.nvm/versions/node/v18.17.0/bin/npm
Watchman:
version: 2024.04.08.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.15.2
path: /Users/enestatli/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.5
- iOS 17.5
- macOS 14.5
- tvOS 17.5
- visionOS 1.2
- watchOS 10.5
Android SDK:
API Levels:
- "29"
- "30"
- "31"
- "33"
- "33"
- "34"
Build Tools:
- 30.0.2
- 30.0.3
- 31.0.0
- 33.0.0
- 33.0.1
- 33.0.2
- 34.0.0
System Images:
- android-30 | Google APIs Intel x86 Atom
- android-30 | Google Play ARM 64 v8a
- android-33 | Google APIs ARM 64 v8a
- android-34 | Google APIs ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2022.3 AI-223.8836.35.2231.10406996
Xcode:
version: 15.4/15F31d
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.9
path: /usr/bin/javac
Ruby:
version: 2.7.6
path: /Users/enestatli/.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
Stacktrace or Logs
-
Reproducer
https://snack.expo.dev/@enestatli65/quiet-orange-strawberries
Screenshots and Videos
No response
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从链接的 Snack 复现示例开始,使用多行 TextInput、超过 40 的 fontSize 和较长的值,在 iOS 设备或模拟器上验证该行为。调查 iOS 的 TextInput 路径;完成的标准是文本在 iOS 上以较大字号可见,同时现有的 Android 行为保持不变。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- react-native
- 领域
- mobile
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100