diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java index 003beb4b9a34c5..7fe0d10ea0f568 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java @@ -623,12 +623,12 @@ public void maybeSetText(ReactTextUpdate reactTextUpdate) { if (reactTextUpdate.getText().length() == 0) { setText(null); } else { - boolean shouldKeepCompositeSpan = length() == spannableStringBuilder.length(); + boolean shouldRestoreComposingSpans = length() == spannableStringBuilder.length(); getText().replace(0, length(), spannableStringBuilder); - if (shouldKeepCompositeSpan) { - attachCompositeSpansToTextFrom(spannableStringBuilder); + if (shouldRestoreComposingSpans) { + restoreComposingSpansToTextFrom(spannableStringBuilder); } } mDisableTextDiffing = false; @@ -861,7 +861,7 @@ private void addSpansFromStyleAttributes(SpannableStringBuilder workingText) { * See {@link ReactEditText#manageSpans} for more details. * Also https://github.com/facebook/react-native/issues/11068 */ - private void attachCompositeSpansToTextFrom(SpannableStringBuilder spannableStringBuilder) { + private void restoreComposingSpansToTextFrom(SpannableStringBuilder spannableStringBuilder) { Editable text = getText(); if (text == null) { return;