Skip to content

TextField maxLines = null should occupy all the area available to it #18825

Closed

Description

@d-silveira

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.

Activity

  1. added
    a: text inputEntering text in a text field or keyboard related problems
    p: material_uimaterial_ui package in flutter/packages
    c: new featureNothing broken; request for a new capability
    on Jun 26, 2018
  2. InsanityOnABun commented on Jul 5, 2018

    @InsanityOnABun

    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.

  3. zoechi commented on Jul 5, 2018

    @zoechi
    Contributor

    @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.

  4. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Jul 22, 2018
  5. added this to the milestone on Jan 28, 2019
  6. justinmc commented on Jan 29, 2019

    @justinmc
    Contributor

    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

  7. zoechi commented on Jan 29, 2019

    @zoechi
    Contributor

    Looks like a dup of #15388

  8. justinmc commented on Mar 8, 2019

    @justinmc
    Contributor

    Closing this with #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.

  9. github-actions commented on Aug 15, 2021

    @github-actions

    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.

  10. locked as resolved and limited conversation to collaborators on Aug 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: text inputEntering text in a text field or keyboard related problemsc: new featureNothing broken; request for a new capabilityframeworkflutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions