Messages should have role=status instead of role=contentinfo

Created on 6 February 2018, over 6 years ago
Updated 1 February 2024, 5 months ago

Problem

Messages currently have a role="contentinfo" wrapper for status messages (compared with role="alert" for error messages).

contentinfo is inappropriate here, because it's supposed to be for information about the document as a whole, not status updates. It's a landmark role, and there should only be one such contentinfo region per page. It's intended to serve the same purpose as a top-level HTML footer element. Using contentinfo for messages may be present some confusion for users who navigate by landmark regions.

Proposed resolution

  1. Replace the role="contentinfo" from the message-type wrapper DIV with role="region" and change the aria-label to "System Messages".
  2. Leave the <div role="alert"> in place for the error message group.
  3. Add a <div role="status"> wrapper for Status and Warning message groups.

Here's a simplified before/after summary of this.

Structure BEFORE:

div role="contentinfo" aria-label="Status message"
    h2.visually-hidden
    ul

div role="contentinfo" aria-label="Error message"
    div role="alert"
        h2.visually-hidden
        ul

Structure AFTER:

div role="region" aria-label="System messages"
    
    div role="status" // Status & Warning messages
        h2.visually-hidden
        ul

    div role="alert"  // Error messages
        h2.visually-hidden
        ul
๐Ÿ› Bug report
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Markupย  โ†’

Last updated 3 days ago

No maintainer
Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom andrewmacpherson

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.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024