Skip to content

TextField context menus do not show after focus switch #99707

@Feichtmeier

Description

@Feichtmeier

When you change the focus away from a textfield and focus it again the context menu does not show up on the first try. You need either to refocus it again or making a small edit like adding a letter or removing it:

ya

Minimal example code:

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Home(),
    );
  }
}

class Home extends StatelessWidget {
  const Home({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
          child: SizedBox(
              width: 100,
              child: Column(
                children: const [
                  TextField(),
                  TextField(),
                ],
              ))),
    );
  }
}
Ubuntu 21.10
Flutter installed from git
frederik@carbon:~$ flutter channel
Flutter channels:
  master
* beta
  stable
frederik@carbon:~$ flutter --version
Flutter 2.11.0-0.1.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision b101bfe32f (vor 11 Tagen) • 2022-02-16 07:36:54 -0800
Engine • revision e355993572
Tools • Dart 2.17.0 (build 2.17.0-69.2.beta) • DevTools 2.10.0-dev.1
frederik@carbon:~$ 

Originally posted by @Feichtmeier in #90563 (comment)

CC @justinmc

Metadata

Metadata

Assignees

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.found in release: 2.10Found to occur in 2.10found in release: 2.11Found to occur in 2.11frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions