Should the main-content anchor have a title attribute?

Created on 26 July 2023, 11 months ago
Updated 11 August 2023, 11 months ago

Problem/Motivation

During OpenA11y accessibility checks, the anchor with the attribute id of "main-content" fails with "Link text is unclear - The text "" is unclear without context and may be confusing to screen readers".

I feel that most visitors would have context but some would not if they were linked to a section on a page.

The "skip" link links to the "main-content" anchor which has text.

<a href="#main-content" class="visually-hidden-focusable skip-link">
      {{ 'Skip to main content'|t }}
    </a>

- from templates/layout/html.html.twig

The "main-content" anchor:
<a id="main-content" tabindex="-1"></a>
- from templates/layout/page.html.twig

Proposed resolution

Adding a title attribute to the "main-content" anchor passes the accessibility check like the following:
<a id="main-content" tabindex="-1" title="{{ 'Main Content'|t }}"></a>

🌱 Plan
Status

RTBC

Version

5.5

Component

Code

Created by

🇺🇸United States GreenSkunk Great Valley, NY

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024