[iOS] Toggling `secureTextEntry` prop causes cursor to jump to the end of TextInput
还没有人认领这个 Issue。
- 主要语言
- C++
- 星标
- 127k
- 派生
- 25.3k
- 平均合并
- 1 天 23 小时
- 30 天内合并 PR
- 4
描述
Description
In iOS, when the secureTextEntry prop is toggled while the TextInput is focused, the cursor position always jumps to the end of the input no matter what the previous position was.
React Native Version
0.71.2
Output of npx react-native info
System:
OS: macOS 13.4.1
CPU: (10) arm64 Apple M1 Pro
Memory: 89.78 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node
Yarn: 1.22.15 - ~/.nvm/versions/node/v16.15.1/bin/yarn
npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm
Watchman: Not Found
Managers:
CocoaPods: Not Found
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, 32, 33
Build Tools: 28.0.3, 30.0.3, 33.0.0
System Images: android-31 | Android TV ARM 64 v8a, android-31 | Google APIs ARM 64 v8a, android-32 | Google Play ARM 64 v8a, android-33 | Google APIs ARM 64 v8a
Android NDK: 21.3.6528147
IDEs:
Android Studio: 2022.1 AI-221.6008.13.2211.9514443
Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild
Languages:
Java: 17.0.8 - /usr/bin/javac
npmPackages:
@expensify/react-native: 0.71.2-alpha.3
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: Not Found
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
- Write something on a TextInput, in iOS
- Move the cursor position to a different position
- Toggle secureTextEntry
- Notice that the cursor jumped to the end of the input
Snack, screenshot, or link to a repository
Snack: https://snack.expo.dev/IL4nCHYAQ
Demo:
https://github.com/facebook/react-native/assets/48553277/afd61900-bcd6-47d2-9d38-120c3611e885
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先在 iOS 上运行链接的 Snack,并在一个已获得焦点的 TextInput 上切换 secureTextEntry 时复现光标跳动问题。然后跟踪 iOS TextInput 的实现及其选择处理;当 prop 更改后光标仍保持在之前的位置时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- ios, react-native
- 领域
- mobile
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100