Skip to content

EditableText should use a Focus widget instead of managing its own FocusNode #90562

@justinmc

Description

@justinmc

Most widgets utilize a Focus widget in their build method to manage their focus nowadays, but EditableText still keeps track of its own FocusNode. Instead, we should add a Focus widget to EditableTextState's build method, pass the FocusNode into it, and remove the redundant code around managing the FocusNode.

  • EditableText manually attaches its FocusNode here, when it could be handled by a Focus widget instead.
  • Here is where InkWell sets up its Focus widget, as an example, even though it also allows a FocusNode to be passed in. All of our Material buttons use InkWell to handle their focus.

Metadata

Metadata

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