react / react/react-native

TextInput onChangeText is firing at wrong time when type with Chinese input keyboard in iOS

Ouverte
#30,578 7 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

API: Keyboard Component: TextInput Needs: Triage :mag: Never gets stale Platform: iOS
Langage dominant
C++
Étoiles
127k
Forks
25.3k
Merge moyen
1 j 23 h
PR mergées (30 j)
4

Description

Description

TextInput onChangeText is firing at wrong time. Here is the gif to show the problem.
RPReplay_Final1607783480

I am typing the Chinese wording "你好" with a Chinese input keyboard in iOS.

  1. The char "你" is inputted by the code "人火".
  2. 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.
    螢幕截圖 2020-12-12 下午11 10 33
  3. After I select the char "你" in Chinese input keyboard, onChangeText is triggered twice.
    螢幕截圖 2020-12-12 下午10 56 30

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.

  1. Open https://snack.expo.io/@hkhermanho/textinput-with-chinese
  2. 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.
螢幕截圖 2020-12-12 下午11 02 07

Snack, code example, screenshot, or link to a repository:

https://snack.expo.io/@hkhermanho/textinput-with-chinese

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par reproduire le problème à partir de l’Expo Snack lié sur iOS avec une méthode de saisie chinoise. Suivez la manière dont TextInput gère la composition et le moment où onChangeText est déclenché pendant la séquence de saisie décrite. Le travail est terminé lorsque les callbacks ne se produisent qu’une fois la composition terminée et sont déclenchés deux fois pour deux caractères chinois.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
ios, react-native
Domaine
mobile
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
38/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.