Skip to content

TextField maxLines should be a double, not an int. #35064

@marcglasberg

Description

@marcglasberg

We need to be able to define a fractional maximum number of lines for a TextField. When using an integer number of lines, and there is a lot of text, the user will only see a few of the lines and may think that there are no more.

On the contrary, if you define, say 5.5 lines, and there are in fact, say, 10 lines, the user immediately notices that there is more text to the bottom. In other words, half-lines are visual cues to the users that they are able to scroll to see the rest.

It's a small change that improves usability. To be consistent, I would make minLines also double, although in terms of usability that one is probably not important.

This is NOT a breaking change, and preserves existing maxLines behavior.

Note: I'm the author of #19105 which was fixed by #27205

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: text inputEntering text in a text field or keyboard related problemsc: new featureNothing broken; request for a new capabilityf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.good first issueRelatively approachable for first-time contributorsteam-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