Skip to content

[docs] InputDecoration.enabled should explain how it interacts with suffixIcon #167713

Closed
@navaronbracke

Description

@navaronbracke

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

No one assigned

    Labels

    P2Important issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.fyi-text-inputFor the attention of Text Input teamteam-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