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 - Composer - Previous text is cut off after creating next line #45522

Open
gedu opened this issue Jul 18, 2024 · 5 comments
Open

Android - Composer - Previous text is cut off after creating next line #45522

gedu opened this issue Jul 18, 2024 · 5 comments
Labels
Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Platform: Android Android applications.

Comments

@gedu
Copy link

gedu commented Jul 18, 2024

Description

When the TextInput component is controlled and the multiline prop is set to true, the text gets cut off after writing some text and adding a new line. However, when a new character is added, the text displays correctly.

Steps to reproduce

  1. Add a TextInput
  2. set the value prop and onChangeText
  3. set as true the multiline prop
  4. Add some text
  5. Add a new line, tapping the Enter button on the keyboard
  6. The text is cut off

React Native Version

0.74.3

Affected Platforms

Runtime - Android

Output of npx react-native info

System:
  OS: macOS 13.6.7
  CPU: (10) arm64 Apple M1 Pro
  Memory: 41.83 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.14.0
    path: ~/.nvm/versions/node/v20.14.0/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.7.0
    path: ~/.nvm/versions/node/v20.14.0/bin/npm
  Watchman:
    version: 2023.11.27.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/eduardograciano/.gem/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 22.4
      - iOS 16.4
      - macOS 13.3
      - tvOS 16.4
      - watchOS 9.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.10671973
  Xcode:
    version: 14.3.1/14E300c
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby:
    version: 2.7.5
    path: /Users/eduardograciano/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: false
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

-

Reproducer

https://github.com/gedu/android-composer-reproducer

Screenshots and Videos

android_composer_cutoff_multiline.mp4
Screenshot 2024-07-18 at 15 56 24
Copy link

⚠️ Add or Reformat Version Info
ℹ️ We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.70.2

@shubhamguptadream11
Copy link
Collaborator

@gedu I checked this, it is reproducible in new architecture working correctly in old one.
@cortinico I am looking into this.

@shubhamguptadream11
Copy link
Collaborator

@cortinico While debugging this I found this TODO:


Here we are setting padding to zero.
Where do we need to move this code block?

@j-piasecki
Copy link
Collaborator

I think it's the same issue as this PR is fixing - #42331

@shubhamguptadream11
Copy link
Collaborator

shubhamguptadream11 commented Jul 19, 2024

@j-piasecki I think your forked repo is not in sync with main one.
This file:
packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java no longer exists currently.
Also the code in this file changed:
packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java
Can you just check once. I am trying to test this fix.

@cortinico cortinico added Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. and removed Needs: Author Feedback Needs: Version Info labels Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Platform: Android Android applications.
Projects
None yet
Development

No branches or pull requests

4 participants