Repository navigation
TextOverflow.fade results in unexpected fade direction #13631
Description
Activity
If softWrap is on, then the width constraint is given to the text renderer so it knows where to apply wrapping. The renderer then reports that the text filled the maximum width but would have wrapped to the next line. So the fade effect is then painted at the bottom of the text to signify that the text overflowed its height constraint.
Perhaps then the problem is our understanding of the parameters for Text.
When we don't want text to wrap (but instead clip) we use
maxLinesparameter, which is a standard Android paradigm. It seems like we should be usingsoftWrap: false?If you don't want text to wrap (except at explicit line breaks), then setting
softWrap: falseonTextwill achieve the effect you want. "maxLines" is more about what to do with the lines once they are wrapped.Reacted by Ngoc Quoc HuynhThanks!
I'm going to re-open this bug to make sure the documentation explains this, including screenshots.
- addedd: api docsIssues with https://api.flutter.dev/Issues with https://api.flutter.dev/
on Jan 7, 2018 Pavel-Sulimau commented
on Aug 18, 2019 on Aug 18, 2019 · Hidden as off-topicshow commentMore actions- locked and limited conversation to collaborators
on May 5, 2020 I'm going to re-open this bug to make sure the documentation explains this, including screenshots.
Seems like this wasn't properly re-opened :-)
- unlocked this conversation
on Jun 2, 2023 - addedframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework team
on Jul 18, 2023 - addedP2Important issues not at the top of the work listImportant issues not at the top of the work listtriaged-frameworkTriaged by Framework teamTriaged by Framework team
on Jul 18, 2023 - added a commit that references this issue
on Dec 18, 2023 - added a commit that references this issue
on Dec 28, 2023 This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on Jan 1, 2024 - addedr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
on Feb 1, 2024
results in:
I was expecting it to fade out horizontally. If I set overflow to ellipsis, it works as expected and puts the ellipsis at the end.
If I turn off softwrap, fade works as expected. That's counterintuitive given that I would have expected softwrap to have no effect because of maxLines: 1.