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

CommentFileSizeAuthor
#14 3088500-14.patch689 bytesgauravvvv

Comments

2pha created an issue. See original summary.

2pha’s picture

Component: other » javascript
Category: Feature request » Bug report
2pha’s picture

Title: stick table not passing aria (WCAG2) validation » sticky table not passing aria (WCAG2) validation
2pha’s picture

Issue summary: View changes

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

sd9121’s picture

Assigned: Unassigned » sd9121
sd9121’s picture

Assigned: sd9121 » Unassigned

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

gauravvvv’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new689 bytes

I have added aria-label and it fixes the issue. please review
see reference aria-label

smustgrave’s picture

Status: Needs review » Needs work

Issue summary seems incomplete. Can a link to the violation be added also

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.