Skip to content

canRequestFocus is a duplicate parameter on TextField #149067

@justinmc

Description

@justinmc

Use case

Instead of TextField.canRequestFocus, people should use TextField.focusNode.canRequestFocus. The parameter should be removed to avoid the complexity that comes with this duplication.

Proposal

Deprecate TextField.canRequestFocus. Cases that use it, such as DropdownMenu, should migrate to focusNode.canRequestFocus.

History

TextField.canRequestFocus was added in #117504 as an oversight (see #130011 (comment)).

I attempted to fix this with #132273, but I ran into Google test failures that I wasn't sure how to fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: text inputEntering text in a text field or keyboard related problemsc: proposalA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.team-text-inputOwned by Text Input teamtriaged-text-inputTriaged by Text Input team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions