Skip to content

Add ability to disable highlighting text field on focus in text field on web/desktop #163399

Open
@camfrandsen

Description

@camfrandsen

Use case

This is a follow on to #78895

In that issue, it made it so that when a text field gets focus, it highlights all of the text (which is correct behavior for web/desktop) My question is could we add a parameter to not do that on web/desktop. So by default, it would continue to do that, but I could turn it off on specific text fields.

The use case I have is they could be typing in a text field and then press enter. When they press enter, focus goes to the modal that pops up. When the user dismisses the modal, we want the focus to go back the text field with the same selection that it had before.

Proposal

One of the first comments made in that issue is gspencergoog saying it should be optional at least. My question is could we still make it optional? (obviously in the opposite direction since it is always enabled)

I would love to make the pull to make this change. It is a straight forward change and the unit test for it is very simple. It would also be an amazing learning opportunity for me. Having said that, I could see how it could potentially take more time to review my code 😆

Let me know what you think, and thank you for everything you do!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: desktopRunning on desktopa: text inputEntering text in a text field or keyboard related problemsf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.platform-webWeb applications specificallyteam-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