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:

  1. 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)
  2. 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

  1. Change <main class="page-content ..."> to a <div class="page-content ...">
  2. Put a <main> around the <header class="content-header clearfix"> and the <div class="layout-container"></div> that contains the page content.
  3. 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.

Issue fork drupal-3350947

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

camilledavis created an issue. See original summary.

cilefen’s picture

Issue tags: -keyboard navigation, -keyboard focus, -screen reader

Thank 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

camilledavis’s picture

The 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.

camilledavis’s picture

Issue summary: View changes

camilledavis’s picture

Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs change record, +Needs Review Queue Initiative

Seems 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.

mgifford’s picture

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

camilledavis’s picture

Issue summary: View changes
camilledavis’s picture

Status: Needs work » Needs review

Added a draft change record.

Just tested with Gin, it doesn't seem to be affected due to not using Claro's page.html.twig

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs change record

Tweaked the CR just slightly with before/after snippets for those who are more visual. But CR looks good.

Thanks!

  • nod_ committed e88d26cd on 10.3.x
    Issue #3350947 by camilledavis, smustgrave, mgifford: "Skip to main...

  • nod_ committed 4d0997ca on 10.4.x
    Issue #3350947 by camilledavis, smustgrave, mgifford: "Skip to main...

  • nod_ committed f6da750d on 11.0.x
    Issue #3350947 by camilledavis, smustgrave, mgifford: "Skip to main...

  • nod_ committed 7f4e8a62 on 11.x
    Issue #3350947 by camilledavis, smustgrave, mgifford: "Skip to main...
nod_’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed 7f4e8a6 and pushed to 11.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.