TextInput onChangeText is firing at wrong time when type with Chinese input keyboard in iOS
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C++
- Estrellas
- 127k
- Forks
- 25.3k
- Merge medio
- 1 d 23 h
- PR fusionados (30 d)
- 4
Descripción
Description
TextInput onChangeText is firing at wrong time. Here is the gif to show the problem.

I am typing the Chinese wording "你好" with a Chinese input keyboard in iOS.
- The char "你" is inputted by the code "人火".
- I type with the code "人火" and these two codes are highlighted in grey in the textbox. The input method is still not completed yet. The code "人火" should not be considered as a text change event. However, onChangeText is triggered.

- After I select the char "你" in Chinese input keyboard, onChangeText is triggered twice.

React Native version:
System:
OS: macOS 11.0.1
CPU: (8) x64 Intel(R) Core(TM) i7-8557U CPU @ 1.70GHz
Memory: 751.11 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.15.1 - /usr/local/bin/node
Yarn: Not Found
npm: 6.14.8 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.0 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.2, DriverKit 20.0, macOS 11.0, tvOS 14.2, watchOS 7.1
Android SDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.6953283
Xcode: 12.2/12B45b - /usr/bin/xcodebuild
Languages:
Java: Not Found
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz => 0.63.2
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
- Open https://snack.expo.io/@hkhermanho/textinput-with-chinese
- Type any Chinese characters with Chinese input method
Expected Results
onChangeText should not be fire before the input method is done. It should be fired 2 times for 2 Chinese characters instead of 8 times.

Snack, code example, screenshot, or link to a repository:
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza reproduciendo el problema del Expo Snack enlazado en iOS con un método de entrada chino. Sigue cómo TextInput gestiona la composición y cuándo se activa onChangeText durante la secuencia de entrada descrita. Se considera terminado cuando los callbacks solo se producen después de que finaliza la composición y se activan dos veces para dos caracteres chinos.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- ios, react-native
- Área
- mobile
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 38/100