Skip to content

Cannot invoke action with "enter" key on first menu item of submenu after opening submenu with "enter" key. #9686

@Peter-Schorn

Description

@Peter-Schorn

Provide a general summary of the issue here

For the Menu component with a submenu, when you open the submenu by pressing the "enter" key, pressing the "enter" key again does NOT invoke the action on the first submenu item (which is automatically focused when the submenu opens).

🤔 Expected Behavior?

After the submenu is opened by pressing the "enter" key, pressing the "enter" key again should invoke the action for the first submenu item (which is automatically focused when the submenu opens).

😯 Current Behavior

Pressing the "enter" key does NOT invoke the action on the submenu item. However, if you navigate to a different menu item and then back to the previous menu item using arrow keys, pressing the "enter" key does invoke the action on the menu item.

💁 Possible Solution

No response

🔦 Context

No response

🖥️ Steps to Reproduce

I originally discovered this issue by experimenting with the submenu example code. If you open the "Share" submenu with the "enter" key and then press the "enter" key again, the action for the "SMS" menu item will NOT be invoked (even though it is focused) and the submenu will stay open. The following stackblitz is forked from that example code.

Steps to Reproduce

  • Open this stackblitz project.
  • Click to open the "actions" menu.
  • Use the arrow keys to focus the "Share" menu item.
  • Press the "enter" key to open the submenu of the "Share" menu item.
  • Press the "enter" key again. This should invoke the action for the "SMS" menu item. It doesn't.

The following screen recording demonstrates the bug.

Screen.Recording.2026-02-20.at.9.02.06.PM.mov

Version

react-aria-components: 1.15.1

What browsers are you seeing the problem on?

Chrome, Firefox, Safari

If other, please specify.

No response

What operating system are you using?

macOS

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    🩺 To Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions