Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TextInput interfering with Japanese conversion #1358

Merged
merged 1 commit into from
Aug 24, 2022

Conversation

christophpurrer
Copy link

Please select one of the following

  • I am removing an existing difference between facebook/react-native and microsoft/react-native-macos 👍
  • I am cherry-picking a change from Facebook's react-native into microsoft/react-native-macos 👍
  • I am making a fix / change for the macOS implementation of react-native
  • I am making a change required for Microsoft usage of react-native

Summary

The bug happened anywhere we set a onChangeText event handler on TextInput, and rewrite the inflight text such as shown in
https://github.com/microsoft/react-native-macos/blob/main/packages/rn-tester/js/examples/TextInput/TextInputSharedExamples.js#L137

To fix we have to ignore changes to text if we have incomplete conversions.

Changelog

[macOS] [Fixed] - Fix TextInput interfering with Japanese conversion

Test Plan

Go to macOS Preferences > Keyboard > Input Sources > add "Japanese Romaji". Use traditional conversion per https://support.apple.com/guide/japanese-input-method/enter-japanese-text-jpim10265/mac.

In the textInput type "watashi", select first auto complete option (e.g. press SPACE), then type "tachi", and confirm you get "私たち":

Before

私阿知

Screen.Recording.2022-08-11.at.3.54.41.PM.mov

After

私たち

after.mov

@christophpurrer christophpurrer requested a review from a team as a code owner August 11, 2022 22:58
@Saadnajmi
Copy link
Collaborator

Saadnajmi commented Aug 11, 2022

@chiuam didn't you fix something similar recently?
Edit: was thinking of #1296

@Saadnajmi
Copy link
Collaborator

Is this change verified for other languages other than Japanese? Will double check this doesn't conflict with #1296 before merging

@christophpurrer
Copy link
Author

I would expect it happens to other languages as Japanese - which require a similar input style.
I can't verify that as I only know German, English, Spanish.
The issue was reported by Japanese speaking people internally, hence I only put that language into the title.
Thanks for double checking the change against #1296

The bug happened anywhere we set a onChangeText event handler on TextInput, and rewrite the inflight text such as shown in
https://github.com/microsoft/react-native-macos/blob/main/packages/rn-tester/js/examples/TextInput/TextInputSharedExamples.js#L137

To fix we have to ignore changes to text if we have incomplete conversions.
@chiuam chiuam merged commit a4ade0a into microsoft:main Aug 24, 2022
shwanton pushed a commit to shwanton/react-native-macos that referenced this pull request Feb 13, 2023
shwanton pushed a commit to shwanton/react-native-macos that referenced this pull request Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants