Skip to content

useSwitch inside a useMenu? #4321

Answered by devongovett
binaryartifex asked this question in Q&A
Discussion options

You must be logged in to vote

The ARIA spec doesn't allow interactive elements inside menu items. I think what you'd need to do in this case is make something that looks like a switch but isn't actually a switch, similar to an icon. Then you can use selectionMode to make the items in the menu selectable, and render your fake switches instead of checkmark icons or whatever to indicate the menu item selection state.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by binaryartifex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants