<svg> elements with an img role must have an alternative text

Created on 6 August 2024, 5 months ago
Updated 16 August 2024, 5 months ago

Problem/Motivation

When using the module to include SVGs, they have the attribute role="img" by default, but don't have a title or other text alternative.

Axe DevTools flags this as a problem - see https://dequeuniversity.com/rules/axe/4.9/svg-img-alt

Module users can work around this by specifying a title, but we should try to make the module accessible by default.

Steps to reproduce

Include an SVG in a template without specifying a title.

Proposed resolution

tbc - maybe don't add the role by default?
Read https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/im... more carefully before deciding

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom malcomio

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024