Description
Hello everyone,
yesterday i noticed that a TextInput has a problem displaying Emojis at the end of the fields maxlength.
If i insert the "white happy man with black hair raising one hand" Emoji (iOS) at the position maxlength-1 it shows a square with an "A" in it instead.
If i insert the "white happy man with black hair raising one hand" Emoji (iOS) at the position maxlength-2 it shows a square with an "yellow happy woman with blonde hair raising one hand" in it instead.
If i insert the "white happy man with black hair raising one hand" Emoji (iOS) at the position maxlength-3 it shows a square with an "white happy woman with black hair raising one hand" in it instead.
If i insert the "white happy man with black hair raising one hand" Emoji (iOS) at the position maxlength-4 it shows a square with an "yellow happy woman with blonde hair raising one hand" and the square with an "A" in it instead.
Seems like the maxlength cuts the unicode sign at the end and causes to show different Emojis than inserted
- React Native version: 0.36
- Platform: iOS - tested on iOS 10.1.1
Activity
ericvicenti commentedon Nov 16, 2016
Might be related to this?
#10929
hramos commentedon May 25, 2017
Closing this issue because it has been inactive for a while. If you think it should still be opened let us know why.
euharrison commentedon Jan 17, 2018
This also happen with me.
We have
maxLength={4}
and this is what happen in different cases:mmmm
then works perfectmm😀
then it reach the limits (emojis count 2 characters)😀😀
then it reach the limits (emojis count 2 characters)m😀😀
then it breaks the limits with "5" characteres and bug cleaning all textKavithaSaras commentedon Mar 21, 2018
@euharrison can you please share this plugin link?
euharrison commentedon Mar 21, 2018
@KavithaSaras sorry, which plugin?
My solution was to set a dynamic maxLength that resolve this: