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

Wrong heading order when attachments are used #3561

Open
selfthinker opened this issue Aug 18, 2023 · 2 comments
Open

Wrong heading order when attachments are used #3561

selfthinker opened this issue Aug 18, 2023 · 2 comments
Assignees

Comments

@selfthinker
Copy link
Contributor

selfthinker commented Aug 18, 2023

What

When Whitehall block attachments or the attachment component are used, it can happen that the heading order on the page is wrong because the heading level for attachments is hard-coded.

Example URLs where the context makes the heading level wrong:

Publications used to be fine because they included a "Documents" h2 before the attachments' h3s. See this publication, for example. But that was changed at some point and now the same page has the same issue because the attachments' headings have changed to an H2.

Why

A correct heading hierarchy helps screen reader users understand the structure and relationship of content on a page.

More context

This was found in the 2022 WCAG audit of GOV.UK. It's an accessibility issue but not a WCAG fail.
This issue is not entirely due to the publishing components as some of the markup is coming from Whitehall.

@ollietreend
Copy link
Contributor

Publication pages are always fine because they include a "Documents" h2 before the attachments' h3s. For example, https://www.gov.uk/government/statistics/learning-disability-services-monthly-statistics-commissioner-census-assuring-transformation-august-2015

@selfthinker I think this actually does affect publication pages too.

Looking at the example link you shared, the "Documents" heading is a H2 but so is the attachment title. They're both H2s rather than a H2 and a H3.

Screenshot of HTML structure from the example page

@selfthinker
Copy link
Contributor Author

Looking at the example link you shared, the "Documents" heading is a H2 but so is the attachment title. They're both H2s rather than a H2 and a H3.

Interesting. That has changed since we wrote the original ticket (which was back in October 2022). Back then the heading for the document was an H3. Here is a version from October 2022.

So, yes, you're right. I'll amend the description accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants