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 74910dad3231ed..0b59a3c9e94060 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 @@ -385,7 +385,13 @@ public void maybeSetText(ReactTextUpdate reactTextUpdate) { mContainsImages = reactTextUpdate.containsImages(); mIsSettingTextFromJS = true; - getText().replace(0, length(), spannableStringBuilder); + // On some devices, when the text is cleared, buggy keyboards will not clear the composing + // text so, we have to set text to null, which will clear the currently composing text. + if (reactTextUpdate.getText().length() == 0) { + setText(null); + } else { + getText().replace(0, length(), spannableStringBuilder); + } mIsSettingTextFromJS = false; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {