Open lkmorlan opened 5 years ago
as the tablist/ tab roles override any "listiness" of a <ul>
, there's really no practical point for using a list (unless you want to start with a list and then progressively enhance by programmatically adding roles etc)
Yes, it does seem like it is better progressive enhancement to use a ul
.
if you don't programmatically add the role attributes, but they're already in the markup, it won't do any good...
If a user agent doesn't understand ARIA, they are getting better semantics with ul
.
I would argue that a user would be better off with sections with headings in most cases. Given their structure, sections and headings are also easier to progressively turn into tabs (if you work with static HTML that is).
I have some plans to rewrite the JS for tabs. Would you be OK with me closing this when the new version lands with progressively enhanced section
s & hx
s?
I changed the issue title to reflect that the question is about the tablist element, not the tabpanel element.
As @patrickhlauke pointed out, since the role is included in the static HTML, there is no accessibility difference between using div
or ul
. I would be surprised if you could find a popular user agent that does not correctly map the tablist
role.
We could close this as "won't fix" or keep it open as a potential "enhancement" if there is agreement that there is benefit to making this change. I am tempted to close given the enormity of our backlog and the current stability of the tabs ppattern and examples.
In the tabpanel examples: https://www.w3.org/TR/wai-aria-practices/examples/tabs/tabs-1/tabs.html https://www.w3.org/TR/wai-aria-practices/examples/tabs/tabs-2/tabs.html
role="tablist" is applied to a
div
element. It seems to me that since this is a list of tabs, it ought to be aul
element. Is there a reasondiv
is used?