Menu: A11y add option to change default role of menuitem to additionally support menuitemradio and menuitemcheckbox #14163
Labels
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Bug, feature request, or proposal:
Feature request
What is the expected behavior?
According to the WCAG guide practices you can have a menu item have any of the following roles:
menuitem
,menuitemradio
, ormenuitemcheckbox
.What is the current behavior?
Currently you can only have the default role of
menuitem
which makes it difficult to support a single selected option. See Editor Menubar Example of a menu withmenuitemradio
's.For example if you wanted to create a menu that was used for sorting and shows the currently selected sorted option you need to make the menuitems behave like radios in order to be WCAG compliant.
What are the steps to reproduce?
Providing a StackBlitz reproduction is the best way to share your issue.
StackBlitz starter: https://goo.gl/wwnhMV
https://stackblitz.com/edit/angular-d75nv1
What is the use-case or motivation for changing an existing behavior?
Allow greater support for different types of menus. This will allow you to have a menu that behaves with radios and checkboxes. This is also included in the WCAG Aria Practices examples.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 7.0.0
Is there anything else we should know?
Would be nice to also then set the selected option which would add
aria-checked="true"
.The text was updated successfully, but these errors were encountered: