Skip to content
Browse files

onKeyPress is not fired on Android when entering an Emoji (#24717)

Resolve #24690

This is very simple unicode detecting. Should I improve this solution creating StringsUtils for detecting unicodes in whole react-native project ?

[Android][Fixed] onKeyPress method is calling, when user type emoji
Pull Request resolved: #24717

Differential Revision: D15238388

Pulled By: cpojer

fbshipit-source-id: 038b1040e1c44fd6f9401a3988a782f5778e1209
  • Loading branch information...
Piotr Trocki authored and facebook-github-bot committed May 7, 2019
1 parent fc8008e commit a5c57b4ed4965ac4bb231399fd145da8095cece3
@@ -108,8 +108,8 @@ public boolean setComposingText(CharSequence text, int newCursorPosition) {
public boolean commitText(CharSequence text, int newCursorPosition) {
String key = text.toString();
// Assume not a keyPress if length > 1
if (key.length() <= 1) {
// Assume not a keyPress if length > 1 (or 2 if unicode)
if (key.length() <= 2) {
if (key.equals("")) {

0 comments on commit a5c57b4

Please sign in to comment.
You can’t perform that action at this time.