[Bug][a11y]: Slider input aria-valuetext omits formatOptions for unit #3340
Labels
a11y
Issues related to accessibility
bug
Something isn't working
Component: Range Slider
Component: Slider
triage
An issue needing triage
Code of conduct
Impacted component(s)
Slider, RangeSlider, SliderHandle
Expected behavior
The
aria-valuetext
attribute on theinput[type="range"]
element within the SliderHandle in the Slider shadowDom should include the_forcedUnit
for units not included in Intl.NumberFormatOptions, likepx
orpc
.Possible fix:
formattedValueForHandle
method inHandleController.ts
to include the_forcedUnit
when it is defined on either thehandle
orthis.host
:This:
spectrum-web-components/packages/slider/src/HandleController.ts
Lines 145 to 149 in f21cfa3
Becomes this:
getAriaValueText
inSlider.ts
to remove the concatenation ofthis._forcedUnit
to each of the values.This:
spectrum-web-components/packages/slider/src/Slider.ts
Lines 120 to 128 in f21cfa3
Becomes this:
Actual behavior
While the
_forcedUnit
is included in theoutput
element showing the value(s), the_forcedUnit
gets omitted from thearia-valuetext
attribute on theinput[type="range"]
within the shadowDom.This can be reproduced if you inspect the shadowDom for the Units not included in Intl.NumberFormatOptions example.
Screenshots
No response
What browsers are you seeing the problem in?
No response
How can we reproduce this issue?
Sample code that illustrates the problem
No response
Logs taken while reproducing problem
No response
The text was updated successfully, but these errors were encountered: