-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsc: API breakBackwards-incompatible API changesBackwards-incompatible API changesf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 2.5Found to occur in 2.5Found to occur in 2.5found in release: 2.6Found to occur in 2.6Found to occur in 2.6frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Description
Most multiline TextFields expand to accommodate their hint, except when maxLines is null. Instead, it should accommodate the hint when maxLines is null as well. This would reduce confusion and allow a TextField that grows to any size to accommodate the hint, which is currently not possible.
Correct Case
Setting maxLines allows the TextField to increase in size to fit as much of the hint as possible:
TextField(
minLines: null,
maxLines: 2,
decoration: InputDecoration(
hintText: 'To be, or not to be, that is the question. Whether \'tis nobler in the mind to suffer the slings and arrows of outrageous fortune, or to take arm against a sea of trouble, and by opposing, end them.',
),
)Incorrect Case
However, when maxLines is null, the TextField stays at 1 line regardless of the length of the hint:
TextField(
minLines: null,
maxLines: null,
decoration: InputDecoration(
hintText: 'To be, or not to be, that is the question. Whether \'tis nobler in the mind to suffer the slings and arrows of outrageous fortune, or to take arm against a sea of trouble, and by opposing, end them.',
),
)Metadata
Metadata
Assignees
Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsc: API breakBackwards-incompatible API changesBackwards-incompatible API changesf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 2.5Found to occur in 2.5Found to occur in 2.5found in release: 2.6Found to occur in 2.6Found to occur in 2.6frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team

