tablesort icon indicating copy to clipboard operation
tablesort copied to clipboard

Keyboard accessibility

Open mourner opened this issue 10 years ago • 4 comments

Currently it's not possible to sort the table using keyboard only. All cells should get a tabindex="0", with enter key handled.

mourner avatar Feb 25 '15 20:02 mourner

Sounds like a good idea, but when implemented, there should be an option to not enable this (maybe someone wouldn't want it).

xPaw avatar Feb 26 '15 09:02 xPaw

Yeah, it would be easy to make this optional.

mourner avatar Feb 26 '15 09:02 mourner

I'm not sure who would not want this. And it seems like https://github.com/tristen/tablesort/commit/de14520ddce2213df8fb5685bab082d4219ac8a1 fixes it fine

chaals avatar Sep 07 '16 14:09 chaals

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.

oyvind-stenhaug avatar Mar 15 '19 16:03 oyvind-stenhaug