-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopa: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problems
Description
When the right click menu is open, pressing the escape key should close it. I confirmed that this is the native behavior on Mac and Windows. I assume Linux is the same but I haven't tried.
Steps to reproduce
- Run any Flutter app with a text field on a desktop platform (example given below).
- Right click on the text field. The context menu shows.
- Press the escape key.
Expected: The context menu closes.
Actual: Nothing happens and the context menu remains on the screen.
Solution
We could add a text editing shortcut for this and it should work for now, but if we allow context menus outside of EditableText (as mentioned in #90563), then the Shortcuts widget won't receive the escape when nothing is focused and it won't always work.
@gspencergoog Is it possible to receive a Shortcut when nothing is focused?
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 MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(
appBar: AppBar(
title: const Text('Flutter Demo'),
),
body: const Center(
child: TextField(),
),
),
);
}
}Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopa: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problems
Type
Projects
Status
Done (PR merged)