Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ANDROID] TextAlign does not apply on Text components as children of TextInput #45275

Open
TheProBro opened this issue Jul 4, 2024 · 7 comments
Labels
Component: TextInput Related to the TextInput component. Needs: Triage 🔍 Platform: Android Android applications.

Comments

@TheProBro
Copy link

Description

In android, applying textAlign for children on textInput does not apply. This works in iOS

Steps to reproduce

  1. Create a nested Text Component inside the TextInput
  2. Give Align Styles to the nested text component
  3. In android, the style does not apply, while does in ios

React Native Version

0.74.84

Affected Platforms

Runtime - Android

Output of npx react-native info

System:
  OS: macOS 14.5
  CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
  Memory: 46.77 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 21.7.3
    path: ~/.nvm/versions/node/v21.7.3/bin/node
  Yarn: Not Found
  npm:
    version: 10.5.0
    path: ~/.nvm/versions/node/v21.7.3/bin/npm
  Watchman:
    version: 2024.05.06.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.2 AI-232.10300.40.2321.11668458
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 20.0.1
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.2
    wanted: 0.74.2
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Stacktrace or Logs

N/A

Reproducer

https://snack.expo.dev/cQvwWTDFzX0THj9yNa8CA?platform=android

Screenshots and Videos

No response

@github-actions github-actions bot added Component: TextInput Related to the TextInput component. Platform: Android Android applications. labels Jul 4, 2024
@meetdhanani17
Copy link

meetdhanani17 commented Jul 9, 2024

try to move object inside array it would be working ex. style={style.a} to style={[style.a]}

@meetdhanani17
Copy link

meetdhanani17 commented Jul 9, 2024

https://snack.expo.dev/cQvwWTDFzX0THj9yNa8CA?platform=android

in this site it showing at end if i change textAlign center to right initial showing to center

@TheProBro
Copy link
Author

@meetdhanani17 did you try on the android simulator? if yes can you share a screenshot as im not able to reproduce it on my end.

@meetdhanani17
Copy link

meetdhanani17 commented Jul 10, 2024

@TheProBro

Screenshot 2024-07-10 at 11 29 14 AM

@TheProBro
Copy link
Author

Yes this works, but the issue i raised was if i want to change text align of the text component, i cant as the textinput style overshadows, and this behaviour is not observed in iOS

@meetdhanani17
Copy link

meetdhanani17 commented Jul 10, 2024

can you please share screenshot of both devices with issue difference

@TheProBro
Copy link
Author

Screenshot 2024-07-10 at 12 06 33 PM Screenshot 2024-07-10 at 12 07 36 PM The code is same but result is different

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: TextInput Related to the TextInput component. Needs: Triage 🔍 Platform: Android Android applications.
Projects
None yet
Development

No branches or pull requests

2 participants