-
Notifications
You must be signed in to change notification settings - Fork 25.2k
🐛 Android: Cursor jumps to right when clearing centered TextInput #55457
Copy link
Copy link
Open
Labels
Component: TextInputRelated to the TextInput component.Related to the TextInput component.Needs: AttentionIssues where the author has responded to feedback.Issues where the author has responded to feedback.Needs: ReproThis issue could be improved with a clear list of steps to reproduce the issue.This issue could be improved with a clear list of steps to reproduce the issue.Platform: AndroidAndroid applications.Android applications.
Metadata
Metadata
Assignees
Labels
Component: TextInputRelated to the TextInput component.Related to the TextInput component.Needs: AttentionIssues where the author has responded to feedback.Issues where the author has responded to feedback.Needs: ReproThis issue could be improved with a clear list of steps to reproduce the issue.This issue could be improved with a clear list of steps to reproduce the issue.Platform: AndroidAndroid applications.Android applications.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Description
When using a TextInput with textAlign: "center" on Android, clearing the input causes the cursor to move to the right end of the input instead of staying centered.
This does not happen on iOS — iOS behaves correctly.
This issue makes centered numeric or OTP-style inputs feel broken on Android.
Steps to reproduce
1)Render a TextInput with textAlign: "center"
2)Type any value
3)Clear the value (backspace or programmatically)
4)Observe cursor position
`import React, { useState } from "react";
import { View, TextInput, StyleSheet } from "react-native";
export default function App() {
const [value, setValue] = useState("");
return (
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
padding: 20,
},
input: {
borderWidth: 1,
height: 48,
fontSize: 18,
textAlign: "center",
},
});
`
React Native Version
0.83.0
Affected Platforms
Runtime - Android
Output of
npx @react-native-community/cli infoStacktrace or Logs
MANDATORY Reproducer
https://reactnative.dev/docs/textinput
Screenshots and Videos
TextAlign.issue.webm