Skip to content

FocusManager does not respond to changes in app lifecycle state #142929

@nate-thegrate

Description

@nate-thegrate

Steps to reproduce

  1. Open a Flutter app in Windows, MacOS, or Google Chrome
  2. Click on a TextField (or any other widget that uses a FocusNode)
  3. Click away from the window, and notice that the cursor doesn't stop blinking.

Expected results

It doesn't matter whether I'm using Google Chrome, VS Code, Discord, or a Terminal window: any time a text cursor is blinking, it means that the characters I type will show up there.

And this isn't limited to text fields: if I repeatedly press Tab to navigate through a website, there's a visual indicator that goes away if I click away from the window, and it comes back if I click or Alt+Tab back into it.

Actual results

Flutter apps do not follow this pattern.

Code sample

Widget build(BuildContext context) {
  return TextField();
}

Screenshots or Video

GIF demonstration

Here's a recording of a Chrome window, as an example of how Flutter should behave:
focus node

I've already implemented a fix and have opened a pull request: #142930

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: duplicateIssue is closed as a duplicate of an existing issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions