Leaflet.EasyButton icon indicating copy to clipboard operation
Leaflet.EasyButton copied to clipboard

[accessibility] Use `aria-disabled` to convey the disabled state

Open Malvoz opened this issue 4 years ago • 0 comments

aria-hidden is used in the disabled state:

https://github.com/CliffCloud/Leaflet.EasyButton/blob/cd53db586a10d5a9c4efed003327cad29f4760bf/src/easy-button.js#L289

https://github.com/CliffCloud/Leaflet.EasyButton/blob/cd53db586a10d5a9c4efed003327cad29f4760bf/src/easy-button.js#L296

which only hides the content from screen readers, but the button remains focusable, and because it is aria-hidden="true" nothing is announced to the user when it is focused.

I suggest replacing aria-hidden with aria-disabled to convey to screen readers that the button is currently disabled.
See related Leaflet issue: https://github.com/Leaflet/Leaflet/issues/7211 / PR: https://github.com/Leaflet/Leaflet/pull/7280/files.


Other potentially helpful resources:

Malvoz avatar Dec 01 '20 18:12 Malvoz