missing ARIA label IDs

Created on 6 May 2025, 5 days ago

Problem/Motivation

When specifying accessible names via aria-labelledby, ensure that the label elements exist.

Steps to reproduce

Load a website that has the Klaro module installed and then inspect with either Axe Devtools or Google lighthouse and the accessibility error will appear.

Proposed resolution

Add appropriate label elements to code.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

3.0

Component

Code

Created by

🇬🇧United Kingdom hannahdigidev

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @hannahdigidev
  • 🇩🇪Germany jan kellermann

    Thank you for reporting! We know this problem and removed the broken aria label via JS. Since v 3.0.1 we are giving the title but allow to visually hide the title and do not remove the aria-label-arrtribute. The title should also exist in the markup in any case.

    See https://git.drupalcode.org/project/klaro/-/commit/c5a2876c9fd840cdacc7a6...

    I checked in our development system and there the title exists:

    <h2 id="id-cookie-title">Use of personal data and cookies</h2>

    Maybe can you check if the title still exists in your markup?

  • 🇩🇪Germany jan kellermann

    I tried to reproduce the bug. And if I save an empty title the bug occurs. So you should always add a title but then hide the title inn Settings > Styling > Show title in notice dialog. Maybe should we add this information in the description of the title field?

  • 🇬🇧United Kingdom hannahdigidev

    Thank you for getting back to me with regards to this issue!

    I have just checked your solution of going to Settings > Styling > Show title in notice dialog and this has resolved my issue and the error has gone away in Axe DevTools.

    Maybe should we add this information in the description of the title field? I think it would be a good idea to add the information for future in case others come across this issue!

    Thanks again! :)

Production build 0.71.5 2024