Problem/Motivation

In DataTables responsive mode, column headers that are collapsed/hidden remain in the DOM but are visually hidden. However, their sort controls are still keyboard-focusable via Tab key.

Keyboard users can focus on invisible sort controls, which violates WCAG 2.4.3 (Focus Order) and WCAG 2.4.7 (Focus Visible) - users should only be able to focus on elements they can see.

Proposed resolution

Set tabindex=&quot;-1&quot; on column headers (<th>) that are:

  • Collapsed in responsive mode
  • Fixed columns that are off-screen
  • Otherwise visually hidden

This removes them from the keyboard tab order without affecting mouse interaction or accessibility tree.

Remaining tasks

  • [ ] Detect hidden/collapsed column headers
  • [ ] Dynamically set/remove tabindex=-1 based on visibility
  • [ ] Test keyboard navigation
  • [ ] Verify screen reader behavior remains correct

Comments

dstorozhuk created an issue. See original summary.

dstorozhuk’s picture

Issue summary: View changes
dstorozhuk’s picture

Issue summary: View changes
arthur.baghdasar’s picture

Inlcluded in the 3.0.3

arthur.baghdasar’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.