Layer control should have `role="button"`
See original GitHub issueMotivation
The layer control is intended as (and behaves similarly to) a button, not a link, and should be conveyed as such to screen reader users.
Proposed solution
Set attribute role="button"
on the <a>
element:
Additional context
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
ARIA: button role - Accessibility - MDN Web Docs
The button role is for clickable elements that trigger a response when activated by the user. Adding role="button" tells the screen reader ...
Read more >Do I need role="button" on a <button>? - Stack Overflow
Using role=button on a button element. You do not need to use role=button in general, as button elements have strong native semantics.
Read more >Do I need aria attributes or roles on native elements?
Most of the time, no you don't. If you are using a <button> element as a button or an <a> element as a...
Read more >Enough with the role-play—let's get back to the basics - TPGi
If your HTML has `role` attributes throughout, chances are there are better native elements you should use instead.
Read more >Custom Controls | Web Accessibility Initiative (WAI) - W3C
To ensure robustness, try to reuse HTML elements that do a subset of the ... The example below shows a social media “share...
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
@wiesesascha that’s probably a separate issue. ARIA semantics only affects users of assistive technology (ATs), in this case
role="button"
would convey to these users that this element is a button (that it is actionable, and with which behavior, i.e. button behavior as opposed to link behavior), and because ATs can intercept keyboard input, in some cases it is even required for an otherwise clickable element to be operable (for example markers aren’t keyboard operable when using a screen reader, presumably since they’re not standard interactive elements).@vanillajonathan Indeed, that’d be optimal (noted in https://github.com/Leaflet/Leaflet/issues/3210#issue-4). It requires a CSS button reset (not very hard to accomplish) but OTOH it’s not backwards compatible with people’s code, so that’s a consideration.