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
Currently the getRole(element: Element): string | null method returns "columnheader" for the th element which isn't always the correct choice for the element depending on ancestory and attributes.
Which does appear to be more achievable for this library as we have similar precedent for mapping roles from a combination of local name and attribute value(s) in the implicit role switch statement flow.
Propose that the th logic is moved out of the localNameToRoleMappings map and it's role is instead calculated dynamically as:
Currently the
getRole(element: Element): string | null
method returns"columnheader"
for theth
element which isn't always the correct choice for the element depending on ancestory and attributes.REF: https://github.com/eps1lon/dom-accessibility-api/blob/main/sources/getRole.ts#L62
According to html-aria:
Here I appreciate hands may be tied less the scope of
getRole()
is expanded to start exploring parent elements.According to html-aam:
Which does appear to be more achievable for this library as we have similar precedent for mapping roles from a combination of local name and attribute value(s) in the implicit role switch statement flow.
Propose that the
th
logic is moved out of thelocalNameToRoleMappings
map and it's role is instead calculated dynamically as:rowheader
ifscope="row"
columnheader
ifscope="col"
scope
is one ofrowgroup
,colgroup
, or missing (REF: https://www.w3.org/TR/2011/WD-html5-author-20110809/the-th-element.html#attr-th-scope-auto)As an aside, also raised w3c/html-aria#495 to query why html-aria does not mention the implicit role logic when the
scope
attribute is present.The text was updated successfully, but these errors were encountered: