design-system-react
design-system-react copied to clipboard
Add aria-sort to DataTable headers
By default, even if the table column isn’t in a sorted state, the hover shows a down arrow. My assumption is that when you sort it descending, the arrow would still point down (in the direction it’s sorted) and that if you click to switch it to ascending, it would flip to up.
That said, there is an
aria-sortattribute that should be placed on the column when sorted. So you would addaria-sort="ascending"oraria-sort="descending"when sorted