Problem/Motivation
On admin pages, the header element containing the breadcrumb nav, h1, and (occasionally) primary tabs is located outside of the main landmark. This causes a few accessibility issues:
- Because it's a header element not contained in another landmark, it's interpreted as a "banner" by screen readers. A "banner" landmark should be only used for repetitive, site-oriented content – not content that's specific to the page. (reference: https://www.w3.org/WAI/ARIA/apg/example-index/landmarks/banner.html)
- Because the "Skip to main content" link moves focus to the main element, it skips over this header even though it's essential to the page (not global content).
Steps to reproduce
Using a screen reader, hit enter on the "Skip to main content" link on a logged-in page -- for example, the page for editing your profile. Notice how the screen reader focus skips over the h1 with your username, "View"/"Shortcuts"/"Edit" links, and breadcrumb nav.
Proposed resolution
- Change
<main class="page-content ..."> to a <div class="page-content ...">
- Put a
<main> around the <header class="content-header clearfix"> and the <div class="layout-container"></div> that contains the page content.
- Move
<div class="visually-hidden"><a id="main-content" tabindex="-1"></a></div> to be the first child of the new <main>.
User interface changes
"Skip to main content" link jumps to page-specific header.
Comments
Comment #2
cilefen commentedThank you for taking the time to report a bug.
Can you verify if this is an independent issue from #2784311: "Skip to main content" should link to main tag or similar? That one came up in a search as possibly an existing duplicate.
I removed tags according to the guidelines: https://www.drupal.org/node/3156530
Comment #3
camilledavis commentedThe issues are related, but solving #2784311 would not solve this issue. However the fix for #2784311 could be incorporated into the fix for this issue.
Comment #4
camilledavis commentedComment #6
camilledavis commentedComment #7
smustgrave commentedSeems like something that could use a change record. Know the popular admin theme gin builds off claro. So contrib themes may need to update also.
Comment #8
mgiffordAdding tagging for WCAG SC 3.2.3 - https://www.w3.org/WAI/WCAG21/Understanding/consistent-navigation.html
Comment #12
camilledavis commentedComment #13
camilledavis commentedAdded a draft change record.
Just tested with Gin, it doesn't seem to be affected due to not using Claro's page.html.twig
Comment #14
smustgrave commentedTweaked the CR just slightly with before/after snippets for those who are more visual. But CR looks good.
Thanks!
Comment #20
nod_Committed 7f4e8a6 and pushed to 11.x. Thanks!