-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A11y support #65
Comments
Hi @acromatica, thanks looking into the accessibility issues! I've been meaning to resolve the attributes for a while but wasn't able to settle on a good solution. Do you know which attributes would be best for the position, and if there's a way to relate the position to the two items? The keyboard navigation should be easy enough to add (there was a previous discussion where this was implemented with custom event bindings). I think there would also need to be a new prop to set how much to increment the position by on key press too. The ordering of the items should be fairly trivial to resolve, I think they could be switched in the render and reordered using CSS I'll start looking into some solutions, let me know if you have any suggestions :) |
Hi Ricky, for sure! The interactions of this slider are very similar to a range selector, so you should look into ARIA slider role: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/slider_role The attributes you need to add to the handle element:
Alternatively, instead of
Re the ordering of the items, css order is a great idea 👍 Hope this makes sense, feel free to ping me if you have any questions :) |
That's awesome @acromatica, thanks for the detailed info 🙌 I'll start adding the features this week. |
Any update? |
No progress yet @mbcod3. I'll hopefully get sorted in the next month or so. |
Hey @acromatica, I finally got around to implementing this, there's some testing and minor issues to resolve in Safari (keyboard nav back and forth doesn't move consistently) before releasing but feel free to preview it at https://react-compare-slider-git-feature-a11y-support-nerdyman.vercel.app/ |
This has been released in v3! npm install react-compare-slider@latest
yarn add react-compare-slider@latest
pnpm install react-compare-slider@latest |
Hello. Are you planning to add accessibility support (keyboard navigation and aria attributes for screen readers)?
Right now it's impossible to move the handle using the keyboard, and there is no way to know current position of the handle if you're using a screen reader.
Also as the items are rendered in reverse order (item 2 - item 1) if you're using a screen reader it will read the content in a reverse order as well (first the content of the right block and then the content of the left block).
The text was updated successfully, but these errors were encountered: