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

textInput props textAlign will cause long text to be cut off after the hyphen when out of focus and focus again #44107

Open
LayMui opened this issue Apr 16, 2024 · 0 comments
Labels
Component: TextInput Related to the TextInput component. Needs: Triage 🔍

Comments

@LayMui
Copy link

LayMui commented Apr 16, 2024

Description

textInput: When I type a very long text with a hyphen and the text exceed the view of the textInput and when I go out of focus and enter into focus again, the text after the hyphen will get cut off.
this happen for the css style textAlign props

code snippet:
<TextInput
style={styles.input}
textAlign={'left'}
/>

the above issue happen for all left, right and center

const styles = StyleSheet.create({

input: {
height: 40,
margin: 12,
borderWidth: 1,
padding: 10,
},
..

Steps to reproduce

create the RN app
add the code snippet to the App.tsx
import {
TextInput
} from 'react-native';

<TextInput
style={styles.input}
textAlign={'center'}
/>

React Native Version

0.73.6

Affected Platforms

Runtime - iOS

Output of npx react-native info

info Fetching system and libraries information...
(node:33422) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
System:
  OS: macOS 14.4.1
  CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
  Memory: 42.90 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 21.6.2
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.21
    path: /usr/local/bin/yarn
  npm:
    version: 10.2.4
    path: /usr/local/bin/npm
  Watchman:
    version: 2024.01.22.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - visionOS 1.0
      - watchOS 10.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.1 AI-231.9392.1.2311.11076708
  Xcode:
    version: 15.2/15C500b
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    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.73.6
    wanted: 0.73.6
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Stacktrace or Logs

NA

Reproducer

https://github.com/LayMui/textInput

Screenshots and Videos

Screenshot 2024-04-16 at 10 16 44 AM Screenshot 2024-04-16 at 10 17 01 AM
@github-actions github-actions bot added the Component: TextInput Related to the TextInput component. label Apr 16, 2024
@LayMui LayMui changed the title textInput props textAlign will cause long text to be cut off after the hyphen when out of focus textInput props textAlign will cause long text to be cut off after the hyphen when out of focus and focus again Apr 16, 2024
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 🔍
Projects
None yet
Development

No branches or pull requests

1 participant