diff --git a/packages/menu/src/Menu.ts b/packages/menu/src/Menu.ts index 5a64c94aa02..a553818994c 100644 --- a/packages/menu/src/Menu.ts +++ b/packages/menu/src/Menu.ts @@ -590,7 +590,11 @@ export class Menu extends SizedMixin(SpectrumElement, { noDefaultSize: true }) { protected navigateBetweenRelatedMenus(event: KeyboardEvent): void { const { key } = event; - event.stopPropagation(); + + if (key === 'ArrowRight' || key === 'ArrowLeft') { + event.preventDefault(); + } + const shouldOpenSubmenu = (this.isLTR && key === 'ArrowRight') || (!this.isLTR && key === 'ArrowLeft'); @@ -598,6 +602,7 @@ export class Menu extends SizedMixin(SpectrumElement, { noDefaultSize: true }) { (this.isLTR && key === 'ArrowLeft') || (!this.isLTR && key === 'ArrowRight'); if (shouldOpenSubmenu) { + event.stopPropagation(); const lastFocusedItem = this.childItems[this.focusedItemIndex]; if (lastFocusedItem?.hasSubmenu) { // Remove focus while opening overlay from keyboard or the visible focus @@ -605,6 +610,7 @@ export class Menu extends SizedMixin(SpectrumElement, { noDefaultSize: true }) { lastFocusedItem.openOverlay(); } } else if (shouldCloseSelfAsSubmenu && this.isSubmenu) { + event.stopPropagation(); this.dispatchEvent(new Event('close', { bubbles: true })); this.updateSelectedItemIndex(); }