We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e3cc80 commit a3b9dc2Copy full SHA for a3b9dc2
ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java
@@ -565,7 +565,10 @@ public void maybeSetText(ReactTextUpdate reactTextUpdate) {
565
// When we update text, we trigger onChangeText code that will
566
// try to update state if the wrapper is available. Temporarily disable
567
// to prevent an infinite loop.
568
- getText().replace(0, length(), spannableStringBuilder);
+ int startPosition = getSelectionStart();
569
+ int endPosition = getSelectionEnd();
570
+ setText(spannableStringBuilder);
571
+ maybeSetSelection(mNativeEventCount, startPosition, endPosition);
572
}
573
mDisableTextDiffing = false;
574
0 commit comments