Skip to content

Commit a5c57b4

Browse files
Piotr Trockifacebook-github-bot
Piotr Trocki
authored andcommitted
onKeyPress is not fired on Android when entering an Emoji (#24717)
Summary: 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
1 parent fc8008e commit a5c57b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditTextInputConnectionWrapper.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ public boolean setComposingText(CharSequence text, int newCursorPosition) {
108108
@Override
109109
public boolean commitText(CharSequence text, int newCursorPosition) {
110110
String key = text.toString();
111-
// Assume not a keyPress if length > 1
112-
if (key.length() <= 1) {
111+
// Assume not a keyPress if length > 1 (or 2 if unicode)
112+
if (key.length() <= 2) {
113113
if (key.equals("")) {
114114
key = BACKSPACE_KEY_VALUE;
115115
}

0 commit comments

Comments
 (0)