Skip to content

fix: Chinese or other nonalphabetic language maxLength bug on iOS #28539

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

Closed
wants to merge 1 commit into from

Conversation

aoarashi1988
Copy link

Summary

When input Chinese or Japanese even other nonalphabetic language word , the calculation of text length is wrong, you use the alphabet in TextInput instead of the real word they want to input。
It's an old issue, but still remain in the up-to-date version of react-native, just like the issue #18990.

Changelog

Take markedTextRange into consideration.

[iOS] [fixed] - Chinese or other nonalphabetic language maxLength limit bug

Test Plan

@facebook-github-bot
Copy link
Contributor

Hi @aoarashi1988!

Thank you for your pull request and welcome to our community.We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.

In order for us to review and merge your code, 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.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 6,608,583 0
android hermes armeabi-v7a 6,285,231 0
android hermes x86 6,949,332 0
android hermes x86_64 6,879,998 0
android jsc arm64-v8a 8,916,531 0
android jsc armeabi-v7a 8,556,540 0
android jsc x86 8,741,334 0
android jsc x86_64 9,318,252 0

Base commit: caa7829

@elicwhite
Copy link
Member

Does this issue repro with multi character length emojis as well? If so, can you provide a small repro code?

Having a repro case for this that works when the device language is english would be super helpful as we can put it in the RNTester test suite and make sure it doesn't break in the future.

@react-native-bot react-native-bot added the No CLA Authors need to sign the CLA before a PR can be reviewed. label Apr 7, 2020
@sota000 sota000 self-assigned this Jul 29, 2021
@sota000
Copy link
Contributor

sota000 commented Jul 29, 2021

@aoarashi1988, I know this is a year old pull request, but would you be able to check on the CLA and @TheSavior's comment so that we can review this internally?

@sota000
Copy link
Contributor

sota000 commented Aug 3, 2021

Hi @aoarashi1988, I am going to close this for now to focus on other active PRs, but please reopen if you are able to address the comments above. Thank you for your contribution!

@sota000 sota000 closed this Aug 3, 2021
@KingAmo
Copy link

KingAmo commented Oct 8, 2022

related PR #31376
any updates please ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
No CLA Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants