-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Closed
Closed
Copy link
Labels
Component: TextInputRelated to the TextInput component.Related to the TextInput component.Issue: Author Provided ReproThis issue can be reproduced in Snack or an attached project.This issue can be reproduced in Snack or an attached project.Needs: Triage 🔍Platform: iOSiOS applications.iOS applications.StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.
Description
Description
If the max length of a controlled TextInput is exceeded on iOS onChangeText will get called with an empty string. We noticed this issue when our users added an emoji as the last character in a TextInput. We only see the issue on iOS, on Android the the emoji can not be added. Since emojis are counted as two chars I'm guessing the emoji is causing the text to have length maxLength+1 and that is causing issues on iOS.
Using an uncontrolled TextInput the emoji is replace with the last character in the screenshot below but keeps it's value.

React Native version:
0.61.4
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
- Create a controlled TextInput with a maxLength
- Input text until you reach maxLength - 1
- Add a emoji
Expected Results
Same behaviour as on Android that the emoji is not accepted as input.
Snack, code example, screenshot, or link to a repository:
jdmunro, karuana, RishavKumar-3796, rasom and AlbertVilaCalvokaruana and rasom
Metadata
Metadata
Assignees
Labels
Component: TextInputRelated to the TextInput component.Related to the TextInput component.Issue: Author Provided ReproThis issue can be reproduced in Snack or an attached project.This issue can be reproduced in Snack or an attached project.Needs: Triage 🔍Platform: iOSiOS applications.iOS applications.StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.