Skip to content

Add TextInputType.none #83567

@jpnurmi

Description

@jpnurmi

Use case

It would be great to be able to disable the virtual keyboard for certain TextFields.

Proposal

Introduce TextInputType.none that can be specified as the keyboard type for TextField. Flutter should not open the virtual keyboard when such text field gains focus.

In order to avoid the platform keyboard popping up, Flutter for Web needs to set the input element's inputmode attribute to none. This matches well with the TextInputType enum that is already used to define the attribute.

Similarly, the rest of the platforms need to respect TextInputType.none when passed in the text input configuration.

Additional notes

This would lay the foundations for custom in-app virtual keyboards: #68988 and #76072.

PR: #83974

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: text inputEntering text in a text field or keyboard related problemsc: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions