axe-core
axe-core copied to clipboard
Consider making aria-treeitem-name a WCAG rule
Currently elements with role=treeitem, without an accessible name are failed as a best practice, instead of a WCAG rule. The reason for that was to account for static treeitems. It is hard to argue that those are failures of WCAG.
Another way we could have done that, which is more involved, but I think I would prefer is to make it a WCAG rule, and flag static treeitems for review, so that:
<div role="treeitem">hello</div> <!-- pass -->
<div role="treeitem"></div> <!-- needs review -->
<div role="treeitem" tabindex="0"></div> <!-- violation; wcag2a, wcag412 -->
When is an empty treeitem ok?
There's nothing in WCAG that would fail an empty treeitem that is not focusable.