From 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b Mon Sep 17 00:00:00 2001 From: fabriziobertoglio1987 Date: Thu, 28 May 2020 10:54:18 +0200 Subject: [PATCH] fix textinput cursor jump to right when input null --- .../facebook/react/views/textinput/ReactTextInputManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java index 8b5b13a6a5be75..b86ee79ed8f895 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java @@ -406,7 +406,8 @@ public void setAllowFontScaling(ReactEditText view, boolean allowFontScaling) { @ReactProp(name = "placeholder") public void setPlaceholder(ReactEditText view, @Nullable String placeholder) { - view.setHint(placeholder); + String text = placeholder == null ? "" : placeholder; + view.setHint(text); } @ReactProp(name = "placeholderTextColor", customType = "Color")