From a2382f5418545c2d574786d0f63551d333a3ad05 Mon Sep 17 00:00:00 2001 From: Murilo Araujo Date: Sun, 21 Oct 2018 19:38:35 -0300 Subject: [PATCH 1/2] Fixed a bug where if set to multiline and numeric the input doesn't breaks the line --- .../com/facebook/react/views/textinput/ReactEditText.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java index c8d2f05c5b57..525b8eb6049e 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java @@ -331,6 +331,13 @@ public void setInputType(int type) { // Input type password defaults to monospace font, so we need to re-apply the font super.setTypeface(tf); + /** + * If set forces multiline on input, because of a restriction on Android source that enables multiline only for inputs of type Text and Multiline on method {@link android.widget.TextView#isMultilineInputType(int)}} + * Source: {@Link TextView.java} + */ + if (isMultiline()) + setSingleLine(false); + // We override the KeyListener so that all keys on the soft input keyboard as well as hardware // keyboards work. Some KeyListeners like DigitsKeyListener will display the keyboard but not // accept all input from it From 8a7c0992887dace9d02404f1f5c62c5d433ba8c6 Mon Sep 17 00:00:00 2001 From: Christoph Nakazawa Date: Thu, 21 Feb 2019 14:02:37 +0900 Subject: [PATCH 2/2] Update ReactEditText.java --- .../java/com/facebook/react/views/textinput/ReactEditText.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java index 525b8eb6049e..5df565569f2a 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java @@ -335,8 +335,9 @@ public void setInputType(int type) { * If set forces multiline on input, because of a restriction on Android source that enables multiline only for inputs of type Text and Multiline on method {@link android.widget.TextView#isMultilineInputType(int)}} * Source: {@Link TextView.java} */ - if (isMultiline()) + if (isMultiline()) { setSingleLine(false); + } // We override the KeyListener so that all keys on the soft input keyboard as well as hardware // keyboards work. Some KeyListeners like DigitsKeyListener will display the keyboard but not