tablesort
tablesort copied to clipboard
Keyboard accessibility
Currently it's not possible to sort the table using keyboard only. All cells should get a tabindex="0", with enter key handled.
Sounds like a good idea, but when implemented, there should be an option to not enable this (maybe someone wouldn't want it).
Yeah, it would be easy to make this optional.
I'm not sure who would not want this. And it seems like https://github.com/tristen/tablesort/commit/de14520ddce2213df8fb5685bab082d4219ac8a1 fixes it fine
Shouldn't tabindex in that commit rather be tabIndex, though?
And while browsers seem to agree that activating (e.g.) a <button> via keyboard should trigger a click event, the same does not apply for <th>.
Will screen reader users get sufficient indication from a tabindex-ed table header cell to understand what it's for (that it can be activated to change the sort order)? I'm currently trying to work around this issue by adding an actual button (which can have a label/text in it, has a known role, may also be activated by space key etc) to each cell. (I guess that means I wouldn't want tabindex on the cell.) I suppose that can be quite "chatty", though.