You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
Note: role='none' can be replaced with role='presentation' which is supported by more browsers. <a> can be replaced with <button> or <div> for other purposes.
It is important that the click handler is on the element that is focusable both by the browser as well as by the screen reader. This means it has to be either a naturally tabbable element or element with tabIndex >= 0 and it has to have role='menuitem'.
This can be achieved by small modifications to current MenuItem.tsx code for Shorthand API:
<li> needs to be marked as role=presentation
onClick handler needs to move from the root element to <a>
<a> will need to be marked as role='menuitem' (which will be applied by the behavior)
Is there a way to achieve this in the Child API?
Or if user provides child components then it is his responsibility to conform to the standard approach and we just need to document this?
<ul class="ui-menu a u b c d e f">
<li class="ui-menu__item v g h i j k l m n o p q r w x y z" onclick='...'>
<a class="ui-menu__item__anchor s t">Editorials</a>
</li>
</ul>
Version
0.2.3
Testcase
The text was updated successfully, but these errors were encountered:
#61)
* feat(Menu): Accessibility - move MenuItem onClick handler from li to a
* - fixed conformance test for MenuItem
* underlined MenuItem border px -> rem
* closes#44
Bug Report
Steps
Open Stardust components page, navigate to Menu examples and observe HTML generated for both Shorthand and Children API.
Expected Result
According to ARIA best practices as well as to our testers, the menu structure should have following structure:
Note:
role='none'
can be replaced withrole='presentation'
which is supported by more browsers.<a>
can be replaced with<button>
or<div>
for other purposes.It is important that the click handler is on the element that is focusable both by the browser as well as by the screen reader. This means it has to be either a naturally tabbable element or element with tabIndex >= 0 and it has to have role='menuitem'.
This can be achieved by small modifications to current MenuItem.tsx code for Shorthand API:
<li>
needs to be marked asrole=presentation
onClick
handler needs to move from the root element to<a>
<a>
will need to be marked asrole='menuitem'
(which will be applied by the behavior)Is there a way to achieve this in the Child API?
Or if user provides child components then it is his responsibility to conform to the standard approach and we just need to document this?
Reference: https://www.w3.org/TR/wai-aria-practices/examples/menubar/menubar-1/menubar-1.html
Actual Result
Version
0.2.3
Testcase
The text was updated successfully, but these errors were encountered: