You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, the useSortBy hook doesn't come with much default accessibility (as far as I'm aware). I think it would be a good idea to add some sensible defaults to the getSortByToggleProps function. For example:
tabindex on the sort element
using aria-label="Toggle Sort" in addition to the title="Toggle Sort" attribute already being used
role="button" on the sort element
keydown listener to toggle sorting when user presses Enter or Space key
Another one is aria-sort, however it looks like that should only be used directly on a th element, so if the developer is applying these props to an element nested inside, it may not be correct. Not sure what the best way would be to incorporate this.
If this is something you'd like included, or if anyone has any suggestions/corrections (I'm no a11y expert) please feel free to respond below :)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
At the moment, the useSortBy hook doesn't come with much default accessibility (as far as I'm aware). I think it would be a good idea to add some sensible defaults to the
getSortByToggleProps
function. For example:tabindex
on the sort elementaria-label="Toggle Sort"
in addition to thetitle="Toggle Sort"
attribute already being usedrole="button"
on the sort elementEnter
orSpace
keyAnother one is
aria-sort
, however it looks like that should only be used directly on ath
element, so if the developer is applying these props to an element nested inside, it may not be correct. Not sure what the best way would be to incorporate this.If this is something you'd like included, or if anyone has any suggestions/corrections (I'm no a11y expert) please feel free to respond below :)
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions