ibm-js/deliteful

List: Should assign aria-label to list's container.

wlepinski opened this issue · 2 comments

A WAI-ARIA widget and specific WAI-ARIA roles must have an accessible name specified with aria-label, aria-labelledby or the widget's inner text.

Link: http://ausgsa.ibm.com/projects/h/haactools/w3/magicbutton/plugincfg/rulepack/help/idhi_accessibility_check_g1110.html

Creating a List instance should automatically add a aria-label if the role attribute is set. By default the role is assigned via the type attribute of the List class with a default value of grid.

I was thinking about adding a default value for the aria-label attribute like "Grid Content" and expose a property on the List class to be set during instance creation.

@wkeese @brunano21, what do you think about this?

When we did refactor the List widget, we opted to leave to the developer the freedom of setting any aria- attribute, however we did care a bit about that, facilitating the developer job and overriding setAttribute, getAttribute, hasAttribute, removeAttribute in order to push down any aria- attribute (set to the root node) to the list.containerNode, as shown below.
selection_039

So I would say this is not a real issue. It's more a developer's task - he just needs to do list.setAttribute("aria-label", "my label").

Right, it's the application developer's task. A default label like "Grid Content" would be counterproductive because it just repeats information the user already knows, and masks the fact that the container doesn't have a meaningful label.