diff --git a/change/react-native-windows-b3c2f4a8-d704-4a38-b837-993459d15495.json b/change/react-native-windows-b3c2f4a8-d704-4a38-b837-993459d15495.json new file mode 100644 index 00000000000..724f9d5e816 --- /dev/null +++ b/change/react-native-windows-b3c2f4a8-d704-4a38-b837-993459d15495.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Change TextInput cursor behavior", + "packageName": "react-native-windows", + "email": "erozell@outlook.com", + "dependentChangeType": "patch" +} diff --git a/vnext/Microsoft.ReactNative/Views/TextInputViewManager.cpp b/vnext/Microsoft.ReactNative/Views/TextInputViewManager.cpp index 861816dbc72..8888e77e6bf 100644 --- a/vnext/Microsoft.ReactNative/Views/TextInputViewManager.cpp +++ b/vnext/Microsoft.ReactNative/Views/TextInputViewManager.cpp @@ -618,7 +618,7 @@ void TextInputShadowNode::SetText(const winrt::Microsoft::ReactNative::JSValue & auto newValue = react::uwp::asHstring(text); if (oldValue != newValue) { textBox.Text(newValue); - if (static_cast(oldCursor) <= newValue.size()) { + if (oldValue.size() == newValue.size()) { textBox.SelectionStart(oldCursor); } else { textBox.SelectionStart(newValue.size());