-
Notifications
You must be signed in to change notification settings - Fork 198
Closed
Labels
Description
Describe the bug
The sortable table's sorting functionality is not keyboard-accessible.
The table header elements have no role or tabindex, so they are not interactable for screen readers. Our example implementation uses only JS to fire the sort events.
To Reproduce
Steps to reproduce the behavior:
- Go to table example
- Try to use a keyboard to sort the data - see that you cannot focus or interact with the headers.
- Use devtools to set
tabindex="0"on thethelements, to make the headers keyboard interactable. - Focus a sortable tab header and press ENTER.
- Verify the table still has not been sorted (it is only listening for click events)
Expected behavior
I should be able to tab through a table's sortable headers, and press ENTER to change the sort direction.
Sort direction should be announced with aria-sort (it already is).
Reference for example: Material UI sortable table
Additional context
Reported by @paul-geoghegan
Reactions are currently unavailable