Need help with DataTable > TableToolbarMenu #7495
-
Hello Team, I am using a DataTable TableToolbarMenu to include a few menu options with checkboxes but the problem is that the menu closes as soon as the user selects or deselects an option. Is there a way to prevent the menu from closing when user selects or deselects multiple options? Here is the link to code sandbox if you want to take a look: Here is the code:
Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You could try |
Beta Was this translation helpful? Give feedback.
-
Hi there @nikhilkomakula! 👋 Unfortunately, combining the Checkbox and Overflow Menu in this way will cause some accessibility violations 😞 I believe the interaction that would be needed is for the option to be of role While this isn't a direct example, I believe: https://www.w3.org/TR/wai-aria-practices/examples/menubar/menubar-2/menubar-2.html captures some of these ideas with the menu dropdowns. Unfortunately, this is a drawback of |
Beta Was this translation helpful? Give feedback.
Hi there @nikhilkomakula! 👋
Unfortunately, combining the Checkbox and Overflow Menu in this way will cause some accessibility violations 😞
I believe the interaction that would be needed is for the option to be of role
menuitemradio
and instead, by default, it ismenuitem
. Similarly, theCheckbox
(which uses an<input type="checkbox">
under the hood) wouldn't communicate thearia-checked
attribute that is needed along withmenuitemradio
.While this isn't a direct example, I believe: https://www.w3.org/TR/wai-aria-practices/examples/menubar/menubar-2/menubar-2.html captures some of these ideas with the menu dropdowns.
Unfortunately, this is a drawback of
OverflowMenu
especially when combine…