Accordion > Remove tab semantics
The following was discovered during the initial accessibility audit for accordions &5663 (closed).
Problem
Currently, accordions are coded more like a tab panel, but they shouldn’t be.
-
role=“tablist"
shouldn’t be used on parent container. - The button has role=“tab” and type=“button” which are not necessary.
- The content panel shouldn’t have role="tabpanel"
Solution
- Per the authoring practices, the parent container needs no role, and
role="tablist"
should be reserved for tabs. Refer to the tabs authoring practices. - The
button
semantics are enough on their own and don’t need either of these.role=“tab”
should only be used for tabs. Refer to the tabs authoring practices. -
role="tabpanel"
should be removed, it’s only to be used for tabs. Refer to the tabs authoring practices.
Edited by Jeremy Elder