mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-01-12 22:50:10 +08:00
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: https://github.com/facebook/react-native/pull/24717 Differential Revision: D15238388 Pulled By: cpojer fbshipit-source-id: 038b1040e1c44fd6f9401a3988a782f5778e1209
This commit is contained in:
committed by
Facebook Github Bot
parent
fc8008e0b2
commit
a5c57b4ed4
@@ -108,8 +108,8 @@ class ReactEditTextInputConnectionWrapper extends InputConnectionWrapper {
|
||||
@Override
|
||||
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("")) {
|
||||
key = BACKSPACE_KEY_VALUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user