Closed
Description
Use case
If I have a TextField
widget that uses a suffixIcon
, but the text field has enabled: false
, the suffixIcon is not interactable, even though it has an onPressed
set.
Example:
TextField(
enabled: false,
decoration: InputDecoration(
suffixIcon: IconButton(
onPressed: () {
print('pressed');
},
icon: Icon(Icons.edit_outlined, size: 20, color: Colors.blue),
)
),
)
I tried setting the enabled
state of the InputDecoration, but that didn't help.
Per the docs:
If false helperText, errorText, and counterText are not displayed, and the opacity of the remaining visual elements is reduced.
Related: flutter-form-builder-ecosystem/flutter_form_builder#442
Proposal
Let the suffix icon handle its enabled state separately from the text field's enabled state. Maybe by allowing it to read the enabled state separately from the InputDecoration, without looking at TextField.enabled ?
Metadata
Metadata
Assignees
Labels
Important issues not at the top of the work listEntering text in a text field or keyboard related problemsNothing broken; request for a new capabilityA detailed proposal for a change to Flutterflutter/packages/flutter repository. See also f: labels.For the attention of Text Input teamOwned by Design Languages teamTriaged by Design Languages team