[iOS] The styling does not change when the CJK character enter TextInput
还没有人认领这个 Issue。
- 主要语言
- C++
- 星标
- 127k
- 派生
- 25.3k
- 平均合并
- 1 天 23 小时
- 30 天内合并 PR
- 4
描述
Description
When entering CJK characters in the TextInput component, the styling does not change.
I wanted to change the styling according to the type of characters entered, but I don't think react can detect the state change.
The example screen is,
The even number of letters is red
The odd-numbered letter is a simple logic that handles it in blue.
Logic does not work in Korean while it works normally in the English environment.
From searching, it seems that this phenomenon occurs in Korean, Chinese, and Japanese equally.
Steps to reproduce
- The even number of letters color is red, The odd-numbered letter color is blue.
- type english / type CJK Character
React Native Version
0.72.6
Affected Platforms
Runtime - iOS
Output of npx react-native info
System:
OS: macOS 13.5
CPU: (10) arm64 Apple M1 Pro
Memory: 66.83 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 16.14.0
path: ~/.nvm/versions/node/v16.14.0/bin/node
Yarn:
version: 1.22.19
path: ~/.nvm/versions/node/v16.14.0/bin/yarn
npm:
version: 8.3.1
path: ~/.nvm/versions/node/v16.14.0/bin/npm
Watchman:
version: 2023.10.23.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.14.2
path: /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 22.4
- iOS 16.4
- macOS 13.3
- tvOS 16.4
- watchOS 9.4
Android SDK:
API Levels:
- "28"
- "29"
- "30"
- "31"
- "33"
- "34"
Build Tools:
- 29.0.2
- 29.0.3
- 30.0.2
- 30.0.3
- 31.0.0
- 32.0.0
- 33.0.0
System Images:
- android-29 | Intel x86 Atom_64
- android-29 | Google APIs ARM 64 v8a
- android-29 | Google APIs Intel x86 Atom_64
- android-30 | Google APIs Intel x86 Atom
- android-30 | Google Play Intel x86 Atom
- android-33 | Google APIs ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2021.3 AI-213.7172.25.2113.9014738
Xcode:
version: 14.3.1/14E300c
path: /usr/bin/xcodebuild
Languages:
Java:
version: 11.0.17
path: /usr/bin/javac
Ruby:
version: 3.1.4
path: /Users/dev002/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.6
wanted: 0.72.6
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://github.com/1nno-vator/rn-textinput-cjk-issue
Screenshots and Videos
Work Well: Type English
[Video] Work Well: Type English
https://github.com/facebook/react-native/assets/55885561/d3f59132-27d0-4e15-b0ed-59eb0f89affc
Error Case: Type Korean
[Video] Error Case: Type Korean
https://github.com/facebook/react-native/assets/55885561/b86e14bd-bd9f-49eb-a42f-a347e48dc779
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从链接的 rn-textinput-cjk-issue 复现程序开始,比较在 iOS 上输入英语与输入韩语、中文或日语时 TextInput 的行为。跟踪 TextInput 的变化如何传递到样式逻辑,然后验证 CJK 输入期间偶数/奇数字符的样式会更新,同时不会导致英语输入回归。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- ios, react-native
- 领域
- mobile
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100