Skip to content

TextField.minLines documentation is unclear about its maxLines interaction #143903

@LongCatIsLooong

Description

@LongCatIsLooong

Link to the documentation: https://main-api.flutter.dev/flutter/material/TextField/minLines.html

If this is null (default), text container starts with enough vertical space for one line and grows to accommodate additional lines as they are entered.

This doesn't seem to be true. When maxLines is set to a non-null value, minLine is effectively set to the same value as maxLines. It seems the real meaning of null here is to defer to the maxLines parameter (which makes the default a bit strange, shouldn't the two parameters be orthogonal?).

This is hinted in the maxLines documentation: https://main-api.flutter.dev/flutter/material/TextField/maxLines.html

The input's height is large enough for the given number of lines. If additional lines are entered the input scrolls vertically.
const TextField(maxLines: 2)

but I wasn't able to find anything that directly spells out that interaction when minLines is null but maxLines is non-null.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsd: api docsIssues with https://api.flutter.dev/f: material designflutter/packages/flutter/material repository.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions