Skip to content

Text overflow handling is inconsistent and sometimes wrong. #16450

@gspencergoog

Description

@gspencergoog

It looks like our overflow handling is pretty weird (if not just downright broken).

For instance, the following doesn't result in any overflow handling other than "clip", regardless of the overflow mode:

new Text(
  '''Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n Phasellus sodales eros nec tortor maximus molestie.\nSed metus metus, viverra vel libero sed, commodo consequat ipsum. Sed commodo ultricies ligula, sed ultricies diam dignissim vitae. ''',
  softWrap: true,
  maxLines: 2,
  textAlign: TextAlign.start,
  overflow: TextOverflow.ellipsis,
),

I would expect that since there is more text to be displayed than the maxLines, that we do show the ellipsis at the end of the second line.

Also, if I remove the hard newlines, then the ellipsis does appear at the end of the second line, which is correct, but inconsistent. And if I then switch to overflow to fade, it fades the first line and the second, instead of just the second.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: typographyText rendering, possibly libtxtfound in release: 3.7Found to occur in 3.7found in release: 3.9Found to occur in 3.9frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions