Skip to content

iOS Text numberOfLines doesn't work when text ends with '\n' #26390

Closed
@zhigang1992

Description

@zhigang1992

React Native version:

info
  React Native Environment Info:
    System:
      OS: macOS 10.14.6
      CPU: (8) x64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
      Memory: 725.77 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 10.15.3 - /var/folders/xl/kybfzzd1779bc3cww3rlnbpr0000gn/T/fnm-shell-3675124/bin/node
      Yarn: 1.17.3 - /usr/local/bin/yarn
      npm: 6.4.1 - /var/folders/xl/kybfzzd1779bc3cww3rlnbpr0000gn/T/fnm-shell-3675124/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
      Android SDK:
        API Levels: 23, 26, 27, 28
        Build Tools: 27.0.3, 28.0.3, 29.0.0
        System Images: android-21 | Google APIs ARM EABI v7a, android-21 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
    IDEs:
      Android Studio: 3.4 AI-183.6156.11.34.5692245
      Xcode: 10.3/10G8 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.6 => 16.8.6
      react-native: 0.59.5 => 0.59.5

Steps To Reproduce

  1. use Text component
  2. text end with '\n'
  3. set numberOfLines to 1

Describe what you expected to happen:

It should only span one line.

https://snack.expo.io/@zhigang1992/great-marshmallows

Describe what you expected to happen:

It should only span one line

But

IMG_0758

It works fine on android

IMAGE 2019-09-10 10:19:45

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugPlatform: iOSiOS applications.Ran 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