Skip to content

TextInput does not align its content properly on Android #41035

@Simmoniz

Description

@Simmoniz

Description

The TextInput component doesn't align its content properly when :

  1. User is done editing (on blur). The text stays right aligned as if the cursor was still located at the end.
  2. When the input is controlled. As soon as a value is set through React.useState mechanism, the TextInput content is automatically right aligned as if the cursor was located at the end.

TextInputWrongAlignmentAndroid

On mac (and Web), everything renders correctly.
TextInputAlignmentiOS

On current build (0.72), Previous builds also (0.71, 0.70, etc)

React Native Version

0.72

Output of npx react-native info

System:
OS: Windows 10 10.0.22621
CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
Memory: 3.53 GB / 15.79 GB
Binaries:
Node:
version: 18.14.2
path: C:\Program Files\nodejs\node.EXE
Yarn:
version: 1.22.19
path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm:
version: 9.5.0
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
AllowAllTrustedApps: Enabled
Versions:
- 10.0.19041.0
- 10.0.22000.0
- 10.0.22621.0
IDEs:
Android Studio: Not Found
Visual Studio:
- 17.5.33424.131 (Visual Studio Community 2022)
Languages:
Java: Not Found
Ruby: Not Found
npmPackages:
"@react-native-community/cli": Not Found
react: Not Found
react-native: Not Found
react-native-windows: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: Not found
newArchEnabled: Not found

Steps to reproduce

Run this Expo Snak (https://snack.expo.dev/@gollyjer/react-native-paper-dialog-with-textinput). When done editing first input, text contents are not aligned properly.

Snack, screenshot, or link to a repository

https://snack.expo.dev/@gollyjer/react-native-paper-dialog-with-textinput

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions