You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TextField maxLines = null should occupy all the area available to it #18825
This is my opinion, so check if it makes sense to you.
Personally I think what makes sense is that if you set maxLines=null it logically means it is unbounded, reason why the textField should inherit it's parents constraints instead of starting with one line and growing to it.
If the current behaviour is required by some people, then I suggest a flag be added to control whether it should minimize or maximize it's footprint, similarly to the column with it's MainAxisSize.min and MainAxisSize.max
This is what I propose so that the TextField's syntax makes a little more sense, at least to me.
@InsanityOnABun Upvote using add reaction on the initial comment instead of a comment would make it easier to track the number of affected developers and set the priority.
Indeed we can't change the current API since we need to maintain backwards compatibility, but I've proposed adding an expands parameter that should make this sort of thing doable: #27205
With that PR, you can allow a TextField to inherit its parent's constraints by setting the new expands parameter to true. Setting maxLines: null will continue to mean that the TextField grows with its content, in order to maintain backwards compatibility.
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 -v and a minimal reproduction of the issue.
Activity
InsanityOnABun commentedon Jul 5, 2018
I would like to see this as well.
Edit: apologies on the unneeded comment, I looked at the reaction list first but on desktop it isn't clear that the thumbs up is a "+1" or upvote.
zoechi commentedon Jul 5, 2018
@InsanityOnABun Upvote using add reaction on the initial comment instead of a comment would make it easier to track the number of affected developers and set the priority.
justinmc commentedon Jan 29, 2019
Indeed we can't change the current API since we need to maintain backwards compatibility, but I've proposed adding an
expandsparameter that should make this sort of thing doable: #27205zoechi commentedon Jan 29, 2019
Looks like a dup of #15388
justinmc commentedon Mar 8, 2019
Closing this with #27205.
With that PR, you can allow a
TextFieldto inherit its parent's constraints by setting the newexpandsparameter to true. SettingmaxLines: nullwill continue to mean that theTextFieldgrows with its content, in order to maintain backwards compatibility.github-actions commentedon Aug 15, 2021
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.