-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
Environment
Run the following in your terminal and copy the results here.
npx react-native --version: 5.0.1-alpha2npx react-native info:
System:
OS: Windows 10 10.0.19042
CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor
Memory: 24.86 GB / 31.95 GB
Binaries:
Node: 14.16.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.14.11 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels: 28, 29, 30
Build Tools: 29.0.0, 29.0.1, 29.0.2, 29.0.3, 30.0.0, 30.0.1, 30.0.2, 30.0.3
System Images: android-28 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom
Android NDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
AllowAllTrustedApps: Enabled
Versions: 10.0.18362.0, 10.0.19041.0
IDEs:
Android Studio: Version 4.1.0.0 AI-201.8743.12.41.7042882
Visual Studio: 16.9.31025.194 (Visual Studio Community 2019)
Languages:
Java: 1.8.0_282 - C:\Program Files\OpenJDK\openjdk-8u282-b08\bin\javac.EXE
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.0 => 0.64.0
react-native-windows: ^0.64.0-0 => 0.64.3
npmGlobalPackages:
*react-native*: Not Found
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
- Use a TextInput like:
<TextInputRN
value={props.value ? IBAN.printFormat(props.value, " ") : props.value}
keyboardType={"default"}
returnKeyType={"next"}
onChangeText={onChange}
onSubmitEditing={onSubmit}
autoCapitalize={"characters"}
/>- Write into the field. As soon as an space is added (by IBAN.printformat above), the cursor position is incorrect (-1 where it should be).
Expected Results
The Text to be IBAN-Like formatted CH12 3456 7890 1234 5678 9 when writing CH1234567890123456789
In general, I haven't found a sane way of formatting/modifying TextInput values. Cursor always jumps somewhere.