Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove aria-labelledby from accordion sections #4628

Merged
merged 2 commits into from
Jan 16, 2024

Commits on Jan 16, 2024

  1. Remove aria-labelledby from accordion sections

    Adding `aria-labelledby` to a `<div>` with no explicit role is explicitly disallowed by the 'ARIA in HTML' specification [1] and in our testing provides little or no benefit to users, including users of assistive technologies [2].
    
    We’ve explored using `<section>` elements for each accordion section (for which a label would make sense), however best practise is to limit the use of region landmarks ‘as too many landmarks can dilute their usefulness in quickly navigating to important areas of a page’ [3].
    
    We don’t have clear evidence that marking accordion sections up as regions is useful, so more research is needed in this area.
    
    There has also been a suggestion that we could use `<article>` elements, but it would depend on how the accordion is being used. [4]
    
    We may still want to pursue these options in the future, but until we make a decision on whether the sections should have a semantic role remove the `aria-labelledby` attribute – it’s trivial to reintroduce it later.
    
    [1]: https://www.w3.org/TR/html-aria/#docconformance-naming
    [2]: #2472 (comment)
    [3]: https://www.scottohara.me/blog/2018/03/03/landmarks.html#region
    [4]: #2472 (comment)
    36degrees committed Jan 16, 2024
    Configuration menu
    Copy the full SHA
    50f546e View commit details
    Browse the repository at this point in the history
  2. Document in CHANGELOG

    36degrees committed Jan 16, 2024
    Configuration menu
    Copy the full SHA
    c20d48a View commit details
    Browse the repository at this point in the history