Skip to content

Conversation

@robintown
Copy link
Member

@robintown robintown commented Aug 14, 2025

MenuItems can be used either inside a Menu component (which creates a roving tab index) or simply with an element of role menu. In the latter case, focus would previously land on the cosmetic <input> element, which is a bad idea as it's hidden from accessibility technologies. By turning the parent <div role="menuitemcheckbox"> into a <button> instead, we can ensure that focus always lands on the parent element. This is possible because ToggleMenuItem and CheckboxMenuItem are controlled components these days.

MenuItems can be used either inside a Menu component (which creates a roving tab index) or simply with an element of role menu. In the latter case, focus would previously land on the cosmetic <input> element, which is a bad idea as it's hidden from accessibility technologies. By turning the parent <div role="menuitemcheckbox"> into a <button> instead, we can ensure that focus always lands on the parent element. This is possible because ToggleMenuItem and CheckboxMenuItem are controlled components these days.
@robintown robintown requested a review from a team as a code owner August 14, 2025 12:02
@robintown robintown requested review from t3chguy and removed request for a team August 14, 2025 12:02
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Aug 14, 2025

Deploying compound-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: bec2645
Status: ✅  Deploy successful!
Preview URL: https://2e4a8a29.compound-web.pages.dev
Branch Preview URL: https://toggle-accessibility.compound-web.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants