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 creates problems in emoji insertion in the end #22690

Closed
JayantJoseph opened this issue Dec 18, 2018 · 4 comments
Closed
Labels
Bug Component: Text Component: TextInput Related to the TextInput component. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@JayantJoseph
Copy link

Environment

React Native Environment Info:
System:
OS: Windows 10
CPU: (4) x64 Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz
Memory: 1.71 GB / 7.91 GB
Binaries:
Yarn: 1.7.0 - ~\AppData\Roaming\npm\yarn.CMD
npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.1.0.0 AI-173.4819257

Packages:
react: 16.6.3
react-native: 0.57.8

Description

Note:This issue is previously reported in issue #10964, but it seems it is marked resolved and closed. So I couldn't comment on it, as the bug still exists. The solution given as the last entry in #10964 doesn't actually solve this issue.

Consider a TextInput with maxLength = [ any value ]

At maxLength-1 enter a smiley with character length 2 [eg: mountain smiley, frowning face] .
Expected output: The smiley doesn't get inserted as only 1 character can be inserted, or the smiley is inserted completely considering it as a single character.
Actual output: The smiley gets cut and some other character is shown. Same could happen for other smileys also [with character length > 2].

Similarly,
At maxLength-2 enter a smiley with character length 3, and they get cut into some other symbols.

Note: I think this is because at maxLength -1, only one character can be entered, so when we insert a smiley at that position, only 1 character of the emoji is being entered and the rest is omitted. That is, if the smiley [say, character size 4] inserted is larger than the remaining space[say, 2], characters up to the remaining space is taken and the rest [2] are omitted. This is issue I am facing

@rickhanlonii
Copy link
Member

Similar to #22669

@JayantJoseph
Copy link
Author

JayantJoseph commented Jan 2, 2019

@rickhanlonii Yes both are issues with maxLength and they are similar, but not the same. Maybe both are related to character length? ( of emoji's and special characters )

@stale
Copy link

stale bot commented Aug 4, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Aug 4, 2019
@stale
Copy link

stale bot commented Aug 11, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Aug 11, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Aug 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Component: Text Component: TextInput Related to the TextInput component. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

4 participants