Skip to content

numberOfLines=1 does not work on Safari #2111

Closed
@janicduplessis

Description

@janicduplessis

The problem

numberOfLines={1} has no effect on Safari. This seems to be caused by this commit ab98851#diff-fe65c584905c7546103177805c46541e3c38992b188e97600cd1fec4bce5307f. Safari requires having nowrap for it to work.

How to reproduce

Simplified test case: https://codesandbox.io/s/stupefied-pike-hyhjn?file=/src/App.js

Steps to reproduce:

  1. Open test case in Safari

Safari:

image

Chrome:

image

Expected behavior

Text has an ellipsis and a single line

Environment (include versions). Did this work in previous versions?

  • React Native for Web (version): 0.17.1
  • React (version): N/A
  • Browser: Safari 14.1.1

I made a patch in my fork to use the multiline implementation in all cases, can PR it if it looks good. I think the main issue with using it is slighly lower browser support (no IE). janicduplessis@26fca01

Metadata

Metadata

Assignees

No one assigned

    Labels

    has: prSubject of a pull request

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions