Skip to content

Conversation

@kenirwin
Copy link
Contributor

The proposed fix sets the tabindex="-1" (unfocusable) wherever the "disabled" property is set on the column-sorting functionality.

This is an accessibility fix; currently, all column headers on DataTable have tabindex="0", making them focusable. That's appropriate for interactive components like sortable column headers, but where sorting is disabled, it adds unnecessary keystrokes and disrupts the normal flow of selection on the page (violating WCAG 2.4.3)

I've updated the test snapshots for DataTable to reflect these change -- there are 77 cases where what used to have a tabindex="0" is now tabindex="-1".

Note: This fixes an issue raised in the comments to #1159 but is not a fix for the overall issue the original poster discussed. (They wanted more direct user control over the tabindex for each column; this PR just obviates one potential use-case for that enhancement, and improves on it by enforcing WCAG compliance rather than relying on the component's installer to do so.)

@netlify
Copy link

netlify bot commented Sep 19, 2025

Deploy Preview for react-data-table-component ready!

Name Link
🔨 Latest commit dab7518
🔍 Latest deploy log https://app.netlify.com/projects/react-data-table-component/deploys/68cd91482900e400083d4f91
😎 Deploy Preview https://deploy-preview-1291--react-data-table-component.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jbetancur jbetancur merged commit 48ab9d7 into jbetancur:master Oct 21, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants