fix(ui): use aria-valuetext and disabled attributes on Slider #3083
+12
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's the purpose of this pull request?
getAriaValueText.disabledprop to both inputs.How it works?
Currently, screen readers announce the elements's role (e.g. "horizontal slider", or "slider at") and then the input value. The prop
getAriaValueTextwas supposed to allow a human-readable text containing the current value to be announced instead. However, it was assigned to thearia-labelledbyprop instead ofaria-valuetext.aria-labelledbyshould only be used to reference other elements (viaids) that will act as labels, instead of receiving formatted texts for the input values.After the fix, screen readers should announce the slider's role and then the formatted text provided by the function
getAriaValueText.How to test it?
Aria Attributes
Local Install Instructionsfrom the CodeSandbox CI to update the package.json of a store;getAriaValueTextprop that returns a custom value text;Disabled Attribute
disabledprop to the Slider atom;References
MDN - aria-labelledby