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

[TextInput] maxLength doesn't work correctly with multibyte characters #2343

Closed
ide opened this issue Aug 15, 2015 · 6 comments
Closed

[TextInput] maxLength doesn't work correctly with multibyte characters #2343

ide opened this issue Aug 15, 2015 · 6 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@ide
Copy link
Contributor

ide commented Aug 15, 2015

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.

textinput maxlength issue

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/

@sahrens
Copy link
Contributor

sahrens commented Sep 4, 2015

Probably a just need to use unicode length instead of byte length - want to send a PR?

@ide
Copy link
Contributor Author

ide commented Sep 4, 2015

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?

unicode length instead of byte length

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 ў.

@mkonicek
Copy link
Contributor

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.
It is easy to use - just login with GitHub.

Also, if this issue is a bug, please consider sending a PR with a fix. We rely on the community to provide
bugfixes as the core team is heavily focused working on performance.

@lavystord
Copy link

Any update??

@chengxiaole
Copy link

Any update ? ? ?

@jamessawyer
Copy link

Any news?

@facebook facebook locked as resolved and limited conversation to collaborators Jul 21, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants