Slider: Is there a way to change the content of the aria-valuetext property? #6316
Answered
by
reidbarber
AlmeroSteyn
asked this question in
Q&A
-
I would like to have all screen readers read out the value of the Slider as a percentage. Is there a way to manipulate the aria-valuetext property written on the range input? |
Beta Was this translation helpful? Give feedback.
Answered by
reidbarber
May 7, 2024
Replies: 1 comment 5 replies
-
You should be able to pass in formatOptions={{style: 'percent'}} and have the percent included in the aria-valuetext. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh, I think I see what is happening. The percent format option is just formatting the value, it doesn't have any other context. So .5 = 50%, 1 = 100%, etc. This is just how Intl.NumberFormat() works, which formatOptions goes to.
I think you'll want to set minValue to 0, maxValue to 1, and bring down the step to something like 0.01.