-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Textfield InputDecorator height can grow to accomodate error text #17292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Textfield InputDecorator height can grow to accomodate error text #17292
Conversation
| widget.errorText, | ||
| style: widget.errorStyle, | ||
| textAlign: widget.textAlign, | ||
| overflow: TextOverflow.ellipsis, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you also want to be able to specify the overflow here? I know that at least for Arabic, ellipsis is pretty bad as a choice (it cuts off whole words only, so often doesn't fill the available space). It's a good default, but it would be good to be able to specify it. (See #16450 also)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems reasonable. An alternative would be an error widget value, which would would allow one to display anything at all for the error. The implementation is already structured this way. The hardest part might be deciding what to call the property. Maybe InputDecoration.errorWidget.
If it's OK with you, I'd like to defer this bit of evolution to a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
|
Per @HansMuller this is working as intended - this PR fixed the structure of the counter layout. |
|
@HansMuller Could you add a similar parameter but for helperText, which takes place at the exact same location as errorText ? Because at the moment it seems that we can make a multiline errorText under TextFields, but text given in helperText attribute is still wrapped. Maybe it is intentional? |


Added
InputDecoration.errorMaxLinesandInputDecorationTheme.errorMaxLines. The default is null, which matches the current implementation: the input decorator'serrorTextis '...' clipped to a single line. IferrorMaxLinesis a value greater than 1, the error text will wrap untilerrorMaxLineshave been filled and then '...' clip as before.The InputDecorator's height will grow depending on how many lines (if any) the non-null
errorTextoccupies.Also: changed the type of
InputDecoration.contentPadding. It is now EdgeInsetsGeometry, socontentPaddingvalues can be depend on the text direction.Fixes: #17172
Incorporates the contentPadding change proposed by @xclud in #16329