Skip to content

Commit d62069f

Browse files
[material/menu_anchor.dart] Remove unused early key event listener (#150915)
Removes an unused block of code (I think -- I could be wrong but it does not appear to have any effect).
1 parent 303cbb7 commit d62069f

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

packages/flutter/lib/src/material/menu_anchor.dart

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -544,14 +544,6 @@ _MenuAnchorState? get _previousFocusableSibling {
544544
}
545545
}
546546

547-
KeyEventResult _checkForEscape(KeyEvent event) {
548-
if (event is KeyDownEvent && event.logicalKey == LogicalKeyboardKey.escape) {
549-
_close();
550-
return KeyEventResult.handled;
551-
}
552-
return KeyEventResult.ignored;
553-
}
554-
555547
/// Open the menu, optionally at a position relative to the [MenuAnchor].
556548
///
557549
/// Call this when the menu should be shown to the user.
@@ -592,9 +584,6 @@ _MenuAnchorState? get _previousFocusableSibling {
592584
if (!_isOpen) {
593585
return;
594586
}
595-
if (_isRoot) {
596-
FocusManager.instance.removeEarlyKeyEventHandler(_checkForEscape);
597-
}
598587
_closeChildren(inDispose: inDispose);
599588
// Don't hide if we're in the middle of a build.
600589
if (SchedulerBinding.instance.schedulerPhase != SchedulerPhase.persistentCallbacks) {

0 commit comments

Comments
 (0)