Skip to content

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

Closed
@jenskuhrjorgensen

Description

@jenskuhrjorgensen

🐛 Bug Report

On iOS (and possibly Android), when the length of the text string is the width of the Text component, it adds a linebreak.

This is a copy of this closed issue.

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

Expected Behavior

Don't create an empty new line.

Code Example

https://snack.expo.io/@jenskuhr/text-early-line-wrap

Environment

Expo v. 32.0.0

[skip envinfo]
Newest version of Expo is used. I don't know how a smart way to get the react-native version of Expo, but sniffing around their repo lead to the following:
"react-native": "0.59.5"
"react": "16.8.3"

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugRan CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions