sticky table not passing aria (WCAG2) validation

Created on 17 October 2019, almost 5 years ago
Updated 2 October 2023, 11 months ago

The sticky table library adds an extra table that does not pass accessibility validation.
The error that is returned is "Data tables must have unique names".

Changing line 101 in "core/misc/tableheader.js.
From:
this.$stickyTable = $('<table class="sticky-header"/>').css({
to:
this.$stickyTable = $('<table class="sticky-header" role="presentation"/>').css({
Will fix the issue.

I would post a patch but am in the middle of a project.
For those who want to fix it without altering core, you can make use of libraries-extend: core/drupal.tableheader to load your own js to override the Drupal.TableHeader.prototype.createSticky function.

Edit:
I now get another error with the above applied.
"Layout tables cannot have data table elements and/or attributes".
Maybe aria-hidden is called for?... I'm not sure yet

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Javascript 

Last updated 1 day ago

Created by

🇦🇺Australia 2pha

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

Not all content is available!

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

Production build 0.71.5 2024