-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Description
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 info
N/A
Stacktrace or Logs
N/A
MANDATORY Reproducer
https://reactnative.dev/docs/textinput