-
Notifications
You must be signed in to change notification settings - Fork 331
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
Accordion - Elements must only use allowed ARIA attributes #2472
Comments
Suggestion - add role="region" to the <div class="govuk-accordion" data-module="govuk-accordion" id="accordion-default">
<div class="govuk-accordion__section ">
<div class="govuk-accordion__section-header">
<h2 class="govuk-accordion__section-heading">
<span class="govuk-accordion__section-button" id="accordion-default-heading-1">
Writing well for the web
</span>
</h2>
</div>
<div id="accordion-default-content-1" class="govuk-accordion__section-content" aria-labelledby="accordion-default-heading-1" role="region">
<p class='govuk-body'>This is the content for Writing well for the web.</p>
</div>
</div>
</div> |
Adding Unless we have good evidence that it's useful to make the accordion sections landmark regions (in which case we should probably make them into (Relevant discussion on the use of |
This also occurs in axe in Chrome with a collapsed accordion now that |
Hi @36degrees, I've taken a look at this issue and if everything mentioned in this Github issue is accurate, I think this is a WCAG failure and something we should fix. This is my theory as for how it's currently failing:
For anyone watching this thread, let me know if you think I've misinterpreted the situation 👍 |
If this is a WCAG failure, I'd like to add this to our accessibility statement as a known piece of 'non-accessible content', which is the name of the section where we record accessibility issues which constitute failures of WCAG 2.1 AA. It would be noted as a failure in the GOV.UK Frontend codebase and not one of our website products. This is my drafted note:
|
Which aspect(s) of 4.1.2 do you think it fails on? |
I didn't personally assess it as a failure of 4.1.2, the failure under 4.1.2 is reported by axe DevTools. Here's their explainer page for the rule it says we're breaking: https://dequeuniversity.com/rules/axe/4.6/aria-allowed-attr?application=AxeChrome If we doubt that I could do a more thorough double-check. |
It's going to catch quite a range of issues, some of which by its own description have 'no effect on the accessibility'. Definitely some of the issues it will catch might mean you fail 4.1.2, but I don't think there's a direct correlation. Looked at another way, unless I'm missing something, I think the success criterion still holds 'true' despite the incorrect use of aria-labelledby?
I still agree with fixing it, just not sure it needs to go in the statement unless we can articulate why it's failing. |
Hey @36degrees I agree, I wouldn't personally assess it as a failure of 4.1.2 based on our existing testing and evidence. If we found a combination of assistive tech, browser and OS that ended up doing something funky or buggy because of the My recommendation: We add this to the accessibility statement under the "(c)" category that stresses that it's not a WCAG failure. That way we can test out our use of the accessibility strategy and correctly state that it's not a WCAG fail. I'll also note on the item that it is not a WCAG fail. Here are those 3 options that are available in the accessibility statement for categorising issues:
How does that sound @36degrees? I know it's still not the same as your recommendation, which is to not add it to the accessibility statement. |
Sounds good to me 👍🏻 |
Hello @davidc-gds, I was about to report this issue when I noticed it's open. FYI I found the reference text that states one must not use aria-labelledby in a div unless a role is set. W3 used capital letters as in MUST NOT in the paragraph this links to: https://www.w3.org/TR/html-aria/#example-elements-with-implicit-aria-roles-which-prohibit-naming-from-authors |
I was wondering if there are there any timelines around fixing this bug? Thank you |
Hey @eschweitzer78 thanks for locating the text in the 'ARIA in HTML' specification! At this point, we've added this to our accessibility statement under the category 'Other identified and tracked accessibility concerns'. We still don't have evidence of this being a true WCAG 2.1 AA fail, but it is definitely an incorrect implementation according to the 'WAI-ARIA 1.1' specification. We can now also count it as conflicting with the 'ARIA in HTML' specification, as you've identified. |
@colinrotherham here's a message from @36degrees in a duplicate GitHub issue that came up a couple weeks ago:
We list this in our accessibility statement as a non-WCAG-failing accessibility concern and say "We plan to fix this within 2023." But as far as when it's fixed and how it interacts with release planning, that's up to devs (you, Ollie, others) |
Thanks @dav-idc I'm happy to add a known exception like we do with the Radios Axe rule for #979 For when this gets picked up would you suggest either we:
|
I would want @36degrees to weigh in if he has capacity, but I also figured I may as well just try and see what value we're currently getting out of the As far as I can tell when testing quickly with NVDA and JAWS, the
So basically... I don't know what adding |
We did go ahead with the Axe 4.8 update for Puppeteer last week The violation rule changed to |
In case this issue is currently stuck because:
You could explore using https://developer.mozilla.org/en-US/docs/Web/HTML/Element/article Based on the HTML spec for the article element, it seems like an acceptable use in many accordion cases, but probably not fully appropriate for all. Might still be a decent calculated risk if there's hesitation to use |
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. [3] 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)
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)
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)
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)
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)
- Updated build pipelines to publish test results - Fixed failing `InsightSchoolSteps` test - Resolved accessibility issue raised at alphagov/govuk-frontend#2472 - Fixed bad project reference in `EducationBenchmarking.Platform.Search.App.csproj`
- Updated build pipelines to publish test results - Fixed failing `InsightSchoolSteps` test - Resolved accessibility issue raised at alphagov/govuk-frontend#2472 - Fixed bad project reference in `EducationBenchmarking.Platform.Search.App.csproj`
- Updated build pipelines to publish test results - Fixed failing `InsightSchoolSteps` test - Resolved accessibility issue raised at alphagov/govuk-frontend#2472 - Fixed bad project reference in `EducationBenchmarking.Platform.Search.App.csproj`
- Updated build pipelines to publish test results - Fixed failing `InsightSchoolSteps` test - Resolved accessibility issue raised at alphagov/govuk-frontend#2472 - Fixed bad project reference in `EducationBenchmarking.Platform.Search.App.csproj`
- Updated build pipelines to publish test results - Fixed failing `InsightSchoolSteps` test - Resolved accessibility issue raised at alphagov/govuk-frontend#2472 - Fixed bad project reference in `EducationBenchmarking.Platform.Search.App.csproj`
- Updated build pipelines to publish test results - Fixed failing `InsightSchoolSteps` test - Resolved accessibility issue raised at alphagov/govuk-frontend#2472 - Fixed bad project reference in `EducationBenchmarking.Platform.Search.App.csproj`
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)
Description of the issue
Axe DevTools reports "ARIA attribute: aria-labelledby is not well supported. Use a different role attribute or element."
Element location
#accordion-default-content-1
Need to ensure ARIA attributes are allowed for an element's role
Steps to reproduce the issue
Run the accessibility checker with an expanded accordion
Actual vs expected behaviour
Error should not be reported for the expanded accordion
Environment (where applicable)
GOV.UK Frontend v3.14.0
https://design-system.service.gov.uk/components/accordion/default/index.html
The text was updated successfully, but these errors were encountered: