mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

Setting `aria-label` on a div requires a `role` as well

Open EliRobinson opened this issue 3 years ago • 2 comments

As per W3 guidelines, attaching an aria-label on nameless elements (in this case it's a div by default) does not apply the aria-label.

https://github.com/mapbox/mapbox-gl-js/blob/93ef85650244e67c3b666c93e2c1c4205dfdca3b/src/ui/marker.js#L168

My suggestion would be to add a basic role which would likely be role="img" right next to the line above.

EliRobinson avatar Sep 11 '23 23:09 EliRobinson

if (!this._element.hasAttribute('role')) this._element.setAttribute('role', 'img');

EliRobinson avatar Sep 11 '23 23:09 EliRobinson

Hey, I would love to work on this issue @EliRobinson @stepankuzmin

aviroopjana avatar Sep 14 '23 03:09 aviroopjana