Skip to content

Text component adds a linebreak when string content is equal to width of component #27172

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

Closed
shamilovtim opened this issue Nov 8, 2019 · 5 comments
Labels
Bug Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@shamilovtim
Copy link
Contributor

shamilovtim commented Nov 8, 2019

React Native version:

React Native Environment Info:
    System:
      OS: macOS 10.15.1
      CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
      Memory: 164.17 MB / 16.00 GB
      Shell: 3.0.2 - /usr/local/bin/fish
    Binaries:
      Node: 12.4.0 - /usr/local/bin/node
      Yarn: yarn install v0.21.3
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.46s. - /usr/local/bin/yarn
      npm: 6.11.3 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
      Android SDK:
        API Levels: 26, 27, 28
        Build Tools: 27.0.3, 28.0.0, 28.0.3
        System Images: android-26 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom
    IDEs:
      Android Studio: 3.5 AI-191.8026.42.35.5900203
      Xcode: 11.2.1/11B53 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3
      react-native: https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz => 0.59.8
    npmGlobalPackages:
      eslint-plugin-react-native: 3.2.1
      react-native-cli: 2.0.1

Steps To Reproduce

  1. Add a Text component anywhere in project (add another component underneath it or use a border - needed to see the issue)
  2. Add some text to get it to reach the exact width of the Text component - this may take a few attempts as not all characters have the same width and may require using some punctuation as well
  3. The text will introduce an unwanted linebreak without any characters moving with it, creating a new blank line with no text

Describe what you expected to happen:
Some text should either wrap to the new line or a new line should not be created.

Actual Behavior
On both iOS & Android, when the length of the text string is the width of the Text component, it adds a linebreak, creating extra space below text elements.

My guess is that there's some sort of improper rounding happening with float density pixels or something.

Snack, code example, screenshot, or link to a repository:
https://snack.expo.io/@shamilot/text-early-line-wrap

Screen Shot 2019-11-08 at 2 54 59 PM

Screen Shot 2019-11-08 at 2 54 28 PM

+1 / related:
#15893
#24674
#24977

@shamilovtim shamilovtim added the Bug label Nov 8, 2019
@shamilovtim
Copy link
Contributor Author

Is there any way to get some eyes on this? It's a major bug and it has been largely ignored.

@stale
Copy link

stale bot commented Feb 16, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 16, 2020
@shamilovtim
Copy link
Contributor Author

Backlog

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 16, 2020
@stale
Copy link

stale bot commented May 16, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label May 16, 2020
@stale
Copy link

stale bot commented May 23, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed May 23, 2020
@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

1 participant