Make the disabled state of zoom controls available to ATs
See original GitHub issueThe leaflet-disabled
class is set on zoom controls:
https://github.com/Leaflet/Leaflet/blob/71f73785c91f50821cee4f590c41b14eeddf394c/src/control/Control.Zoom.js#L102-L104
and styles are applied to convey a “disabled” state:
https://github.com/Leaflet/Leaflet/blob/71f73785c91f50821cee4f590c41b14eeddf394c/dist/leaflet.css#L310-L314
the zoom controls remain operable however, and the state is not available to assistive technologies such as screen readers. There are at least 3 ways to convey the disabled state of buttons:
tabindex="-1"
- Bing Maps for example, uses this approach. Though it may be confusing to keyboard-only users, as the button is then removed from the tab order.- The
disabled
attribute - Not applicable (Leaflet uses<a role="button">
as opposed to<button>
). aria-disabled="true"
- May or may not be as well supported as a negativetabindex
or thedisabled
attribute, it does seem to be well supported though.
Whether tabindex="-1"
or aria-disabled="true|false"
is used (I personally vote for the latter), it could be set in addition to the leaflet-disabled
class for backwards compatibility.
Implementing this may satisfy (parts of) the WCAG 2.1 Success Criterion: 1.3.1 Info and Relationships and 4.1.2 Name, Role, Value for the zoom controls.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top GitHub Comments
@AkshataJ96 Nobody seems to be working on this on the moment, feel free to pick it up.
Fixed in https://github.com/Leaflet/Leaflet/pull/7280, thanks!