-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
[TextInput] maxLength doesn't work correctly with multibyte characters #2343
Comments
Probably a just need to use unicode length instead of byte length - want to send a PR? |
I opened this since @monyxie mentioned it in #1945. Perhaps someone with non-English apps who needs this feature would like to work on it?
It might be a little trickier than this if we want to limit the number of glyphs. IIRC combining diacritical marks take up multiple Unicode codepoints but are rendered as one character like ў. |
Hi there! This issue is being closed because it has been inactive for a while. But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/textinput-maxlength-doesnt-work-correctly-with-multibyte-characters ProductPains helps the community prioritize the most important issues thanks to its voting feature. Also, if this issue is a bug, please consider sending a PR with a fix. We rely on the community to provide |
Any update?? |
Any update ? ? ? |
Any news? |
As shown in #1945, TextInput's maxLength prop doesn't work with Chinese characters. It's probably looking at the number of bytes and should be counting codepoints or glyphs instead.
While we're at it, does anyone want to stress test the single/multiline TextInput components with all sorts of Unicode using Naughty Keyboard? https://github.com/Palleas/NaughtyKeyboard/
The text was updated successfully, but these errors were encountered: