You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[menu] Cannot select menu item via enter key when rendered as link #1225
When selecting a menu item that contains a link, for example using a Link component from Inertia.js's Link component, or react-routers, it just closes the menu and doesn't actually go to it. This works fine if you select it with your mouse just not via the enter key.
Expected behavior
I'd expect it to go to the url selected upon pressing the enter key, as it works fine when using the enter key.
Reproducible example
Link to a StackBlitz (You'll need to open the full preview to see the url change).
Base UI version
v1.0.0-alpha.4
Which browser are you using?
Safari, but not relevant here.
Which OS are you using?
Mac OS, but not relevant here.
Which assistive tech are you using (if applicable)?
N/A
Additional context
The browser shows the url at the bottom but it just closes the menu instead of executing the link.
changed the title [-][Menu] Cannot select menu item via enter key when rendered as link[/-][+][menu] Cannot select menu item via enter key when rendered as link[/+]on Aug 10, 2025
Activity
[-]Cannot select menu item via enter key[/-][+][Menu] Cannot select menu item via enter key when rendered as link[/+]atomiks commentedon Dec 27, 2024
@mj12albert This
event.preventDefault()foruseButtonis the causebase-ui/packages/react/src/use-button/useButton.ts
Line 78 in 38f77b6
mj12albert commentedon Dec 31, 2024
There weren't any tests for menu items or useButton rendering link components in the legacy package 🤔
[-][Menu] Cannot select menu item via enter key when rendered as link[/-][+][menu] Cannot select menu item via enter key when rendered as link[/+]