mirror of
https://github.com/status-im/react-native.git
synced 2025-02-13 09:56:44 +00:00
Dirty hack to consume enter key
Differential Revision: D2475863 committer: Service User <svcscm@fb.com>
This commit is contained in:
parent
c1e3f9100e
commit
a37d0f9c20
@ -16,6 +16,7 @@ import java.util.ArrayList;
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.text.Editable;
|
||||
import android.text.InputType;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextWatcher;
|
||||
@ -85,7 +86,8 @@ public class ReactEditText extends EditText {
|
||||
// since we only allow JS to change focus, which in turn causes TextView to crash.
|
||||
@Override
|
||||
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_ENTER) {
|
||||
if (keyCode == KeyEvent.KEYCODE_ENTER &&
|
||||
((getInputType() & InputType.TYPE_TEXT_FLAG_MULTI_LINE) == 0 )) {
|
||||
hideSoftKeyboard();
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user