slider
slider copied to clipboard
rc-slider-handle raises issue with react-aXe accessibility checker
A site operated by my workplace uses react-axe to check the accessibility of the site, and although seemingly a minor issue, react-axe flags the slider handle as non-accessible under: "ARIA input fields have an accessible name". I believe this issue would be recitifed by simply adding an aria-label to the element.
More info on this error can be found here: https://dequeuniversity.com/rules/axe/3.5/aria-input-field-name?application=axeAPI
It looks like there are two props for labeling the handle, but they do not seem to work.
ariaLabelledByForHandle
and ariaLabelForHandle
I would love to make this slider fully accessible as well.
@Shubwub I was able to get the aria-label prop working by doing the following
import Slider, { Handle } from 'rc-slider';
<Slider
// other slider props
handle={({ value, ...restHandleProps }) => (
<Handle value={value} {...restHandleProps} aria-label="your label here"/>
)}
/>