Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Menu] Clicking checkbox/radio items closes menu when defaultOpen #1297

Closed
aarongarciah opened this issue Jan 7, 2025 · 0 comments · Fixed by #1301
Closed

[Menu] Clicking checkbox/radio items closes menu when defaultOpen #1297

aarongarciah opened this issue Jan 7, 2025 · 0 comments · Fixed by #1301
Assignees
Labels
component: menu This is the name of the generic UI component, not the React module!

Comments

@aarongarciah
Copy link
Member

aarongarciah commented Jan 7, 2025

Bug report

Current behavior

When a Menu has the defaultOpen prop, clicking a checkbox or radio item for the first time closes the Menu. This doesn't happen when the checkbox/radio item is activated using the keyboard, so this looks like a pointer only bug. It also doesn't happen when the Menu is closed and reopened. It only happens when clicking checkbox/radio items for the first time when defaultOpen is present.

Kapture.2025-01-07.at.10.00.26.mp4

The attached video showcases these scenarios:

  1. ❌ Menu is defaultOpen: clicking checkbox/radio items closes the Menu.
  2. ✅ Menu is defaultOpen but it's closed and reopen: clicking checkbox/radio items doesn't close the Menu.
  3. ✅ Menu is defaultOpen but it's operated with keyboard: activating checkbox/radio items doesn't close the Menu.

Expected behavior

The Menu should stay open when clicking a checkbox or radio item for the first time when the defaultOpen prop is present.

Reproducible example

https://codesandbox.io/p/sandbox/proud-architecture-qv4gd4

Base UI version

1.0.0-alpha.4

@aarongarciah aarongarciah added the component: menu This is the name of the generic UI component, not the React module! label Jan 7, 2025
@michaldudak michaldudak self-assigned this Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: menu This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants