aria-label and aria-valuetext
See original GitHub issueI can see that <DefautlHandle/>
does declare aria-label
and aria-valuetext
properties.
https://github.com/airbnb/rheostat/blob/563f6a739023dbd3c77311323de109ae66c4ac7c/src/DefaultHandle.jsx#L13-L14
Still, <Handle/>
doesn’t get passed these two properties.
https://github.com/airbnb/rheostat/blob/master/src/Slider.jsx#L803-L821
At the same time, there’s handle
property which is for React.Component
.
So I suppose a developer is supposed to pass their own handle
component which must wrap the <DefaultHandle/>
.
Like this:
function CustomHandle(props) {
return (
<DefaultHandle
{...props}
aria-label={props['data-handle-key'] === 0 ? 'Minimum price' : 'Maximum price'}
aria-valuetext={'$' + props['aria-valuenow']}/>
)
}
Is this the recommended approach to add aria-label
and aria-valuetext
?
If yes then is DefaultHandle
being exported from the library or should it be imported from as rheostat/src/DefaultHandle.jsx
?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top Results From Across the Web
aria-valuetext - Accessibility - MDN Web Docs - Mozilla
The aria-valuetext attribute defines the human readable text alternative of aria-valuenow for a range widget.
Read more >WAI-ARIA: aria-valuetext (Property) - DigitalA11Y
Description. Defines the human readable text alternative of aria-valuenow for a range widget. This property is used, for example, ...
Read more >Technique ARIA8:Using aria-label for link purpose - W3C
In some assistive technologies the aria-label value will show in the list of links instead of the actual link text. Per the Accessible...
Read more >aria-label - examples and best practices - Aditus
aria -label is an attribute defined in the WAI-ARIA(opens in a new tab) specification. This specification extends native HTML, allowing you to change...
Read more >Aria-labelledby vs. Aria-describedby vs. Aria-label
PRESENTER: The aria-labelledby aria-describedby and aria-label attributes can provide an ... and the matching ID value is applied to the label element.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@droda59 I don’t know what exactly worked, but something surely did.
That works, closing.