-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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 a broken input for the Korean alphabet in TextInput #32523
Conversation
Hi @bernard-kms! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
PR build artifact for c679dab is ready. |
Base commit: 8ace78c |
Base commit: 8ace78c |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
@@ -145,26 +145,6 @@ - (void)setTextAlignment:(NSTextAlignment)textAlignment | |||
_placeholderView.textAlignment = textAlignment; | |||
} | |||
|
|||
- (void)setAttributedText:(NSAttributedString *)attributedText |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain why this is redundant and safe to remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Root cause of this issue is updating attributedText
via -setAttributedText:
of RCTBaseTextInputView
.
In this removed block, it attempts to avoid calling the method by comparing two attributed text with bare strings. But it should be handled by -textOf:quals:
which already handles some other special cases such as Chinese and Japanese.
I added detection for Korean to safely fallbacks to bare text comparison in the -textOf:quals:
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found out that it is required to invalidate placeholder visibility in this method. I added a required commit.
Thanks for your fix! Wondering if this was tested off of main and whether other languages have been tested to verify no regressions? |
I've tested some other languages with RNTester: Chinese.movJapanese.movEnglish.mov |
@philIip has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
PR build artifact for 2dd1dc0 is ready. |
Thanks for the ping! I've reached out to @philIip to land |
@philIip Is there something I can do to move this forward? |
@philIip has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @bernard-kms in 1a83dc3. When will my fix make it into a release? | Upcoming Releases |
Summary: <!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? --> Fix #32503 Updating the attributed text in TextView/TextField while inputting Korean language will break input mechanism of the Korean alphabet. This results unexpected text input. This PR supersedes the previous fixes: #19809, #22546 ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [iOS] [Fixed] - Fix a broken input for the Korean alphabet in TextInput Pull Request resolved: #32523 Test Plan: https://user-images.githubusercontent.com/20317121/140013434-1674c391-54d6-4410-b4c1-c633697e639d.mov Reviewed By: lunaleaps, sammy-SC Differential Revision: D32470543 Pulled By: philIip fbshipit-source-id: e7e34bd362fa2ab2ca579103db01ad8d1a891c35
Summary: <!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? --> Fix #32503 Updating the attributed text in TextView/TextField while inputting Korean language will break input mechanism of the Korean alphabet. This results unexpected text input. This PR supersedes the previous fixes: #19809, #22546 ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [iOS] [Fixed] - Fix a broken input for the Korean alphabet in TextInput Pull Request resolved: #32523 Test Plan: https://user-images.githubusercontent.com/20317121/140013434-1674c391-54d6-4410-b4c1-c633697e639d.mov Reviewed By: lunaleaps, sammy-SC Differential Revision: D32470543 Pulled By: philIip fbshipit-source-id: e7e34bd362fa2ab2ca579103db01ad8d1a891c35
Summary
Fix #32503
Updating the attributed text in TextView/TextField while inputting Korean language will break input mechanism of the Korean alphabet. This results unexpected text input.
This PR supersedes the previous fixes: #19809, #22546
Changelog
[iOS] [Fixed] - Fix a broken input for the Korean alphabet in TextInput
Test Plan
RPReplay_Final1635916183_c.mov