We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 483d787 commit c37162cCopy full SHA for c37162c
packages/menu/src/MenuItem.ts
@@ -583,9 +583,10 @@ export class MenuItem extends LikeAnchor(
583
const openSubmenuKey =
584
this.hasSubmenu && !this.open && [' ', 'Enter'].includes(key);
585
if (target === this) {
586
- // Only prevent default for arrow keys and submenu-related keys.
587
- // Don't prevent Escape - let it bubble to close overlays.
588
- if (['ArrowLeft', 'ArrowRight'].includes(key) || openSubmenuKey)
+ if (
+ ['ArrowLeft', 'ArrowRight', 'Escape'].includes(key) ||
+ openSubmenuKey
589
+ )
590
event.preventDefault();
591
this.dispatchEvent(
592
new MenuItemKeydownEvent({ root: this, event: event })
0 commit comments