From c5762a77a9e720e0129175afc38c7dcf23bea7bd Mon Sep 17 00:00:00 2001 From: fabriziobertoglio1987 Date: Tue, 22 Mar 2022 15:28:32 +0800 Subject: [PATCH] revert changes to ReactEditText onChangeText --- .../com/facebook/react/views/textinput/ReactEditText.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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 bd8b06c52f7690..360de688d54849 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 @@ -564,10 +564,7 @@ public void maybeSetText(ReactTextUpdate reactTextUpdate) { // When we update text, we trigger onChangeText code that will // try to update state if the wrapper is available. Temporarily disable // to prevent an infinite loop. - int startPosition = getSelectionStart(); - int endPosition = getSelectionEnd(); - setText(spannableStringBuilder); - maybeSetSelection(mNativeEventCount, startPosition, endPosition); + getText().replace(0, length(), spannableStringBuilder); } mDisableTextDiffing = false;