Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "role=row" and "role=columnheader" in table rows/headers #9261

Closed
Bukama opened this issue Oct 4, 2022 · 0 comments · Fixed by #9265
Closed

Remove "role=row" and "role=columnheader" in table rows/headers #9261

Bukama opened this issue Oct 4, 2022 · 0 comments · Fixed by #9265
Assignees
Labels
accessibility WCAG or ARIA related issues
Milestone

Comments

@Bukama
Copy link
Contributor

Bukama commented Oct 4, 2022

Description

Primeface's data tables is labeling table-headers (<th>) with role="columnheader" and table-rows (<tr>) with role="row".

Both annotations result in warnings and even errors by the NU-HTML-Checker

From the NU HTML Check result of the showcase

Error: The role attribute must not be used on a tr element which has a table ancestor with no role attribute, or with a role attribute whose value is table, grid, or treegrid.

Warning: The row role is unnecessary for element tr.

Error: The role attribute must not be used on a th element which has a table ancestor with no role attribute, or with a role attribute whose value is table, grid, or treegrid.

Warning: The columnheader role is unnecessary for element th.

According to the accessibility (test) team at our work the annotations are also not needed for screenreader users, because the underlying elements (here <th> and <tr>) clearly indicate what kind of element was rendered. The individual roles are only needed if you use e.g. a div as a button.
If they are set, when not needed it might turn bad as some screenreaders might pick the addional annotation and may read out them to the user.

Describe the solution you would like

Remove the role attributs on table-headers and table-rows.

Additional context

The same was already done for other HTML elements with clear purpose, like button (#8481) or textinput (#8467) (and others).

@Bukama Bukama added ‼️ needs-triage Issue needs triaging new feature labels Oct 4, 2022
@jepsar jepsar added accessibility WCAG or ARIA related issues and removed new feature ‼️ needs-triage Issue needs triaging labels Oct 4, 2022
@melloware melloware added this to the 13.0.0 milestone Oct 4, 2022
Bukama added a commit to Bukama/primefaces that referenced this issue Oct 4, 2022
This commit removes the "role"-attribute on every element which are
written as HTML table-row (tr) or table-header (tr) elements.

It's not removed on those where the header row is not rendered as such.

closes primefaces#9261
@melloware melloware linked a pull request Oct 4, 2022 that will close this issue
@melloware melloware modified the milestones: 13.0.0, 12.0.0 Oct 4, 2022
melloware pushed a commit that referenced this issue Oct 4, 2022
This commit removes the "role"-attribute on every element which are
written as HTML table-row (tr) or table-header (tr) elements.

It's not removed on those where the header row is not rendered as such.

closes #9261
@melloware melloware modified the milestones: 12.0.0.Final, 12.0.0 Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility WCAG or ARIA related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants