Skip to content

Commit 20a9473

Browse files
committed
fix textinput cursor jump to right when input null
1 parent 5cde6c5 commit 20a9473

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,8 @@ public void setAllowFontScaling(ReactEditText view, boolean allowFontScaling) {
406406

407407
@ReactProp(name = "placeholder")
408408
public void setPlaceholder(ReactEditText view, @Nullable String placeholder) {
409-
view.setHint(placeholder);
409+
String text = placeholder == null ? "" : placeholder;
410+
view.setHint(text);
410411
}
411412

412413
@ReactProp(name = "placeholderTextColor", customType = "Color")

0 commit comments

Comments
 (0)