Adding default a11y to useSortBy hook #1996
Unanswered
BillyLevin
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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