Skip to content

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

Closed

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.

Activity

  1. added
    a: text inputEntering text in a text field or keyboard related problems
    frameworkflutter/packages/flutter repository. See also f: labels.
    c: proposalA detailed proposal for a change to Flutter
    on Sep 22, 2021
  2. justinmc commented on Oct 6, 2021

    @justinmc
    ContributorAuthor

    @LongCatIsLooong Assigned you as I believe #90684 will fully fix this.

  3. github-actions commented on Nov 17, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  4. locked as resolved and limited conversation to collaborators on Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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