You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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("");
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