You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When visual users look at a map they can easily tell that the controls, attribution, and other (potentially custom) UI components that are placed on the map belong to it. AT users rely on HTML semantics, DOM structure, and ARIA to convey these things and their relationships.
Currently, the tabindex="0", aria-label="Map" and role="region" (which together convey the focusable "map component") are set on the <canvas> which means that any components that are placed outside of it (e.g. the maplibregl-control-container controls and potential custom UI components) aren't programmatically determinable as related to the map's structure.
Notice how in the accessibility tree the button is seemingly not part of any particular semantic structure:
If tabindex="0", aria-label="Map" and role="region" were moved from <canvas> to <div class="maplibregl-map"> the correct structure would be accomplished (and logical focus order guaranteed). However, in this case I suppose the div would have to act as a proxy for canvas in terms of user input, and probably other things, which might get messy.
Another option is to use aria-owns which is seemingly widely supported, straight forward to use, and produces the desired result:
Although, the number 1 rule of using ARIA is to avoid using ARIA if you can. And there's also the consideration of how aria-owns should work with developers' custom UI components.
@HarelM Unfortunately I am not familiar with the MapLibre codebase, and MapLibre is only 1 of many web maps that I have reported issues for so it would not feasible for me to spend the time on all these projects.
Thanks @Malvoz for opening the accessibility issues. I think they are valuable and if questions regarding accessibility come up, for example like in #344, I will take the freedom to ping you and ask for expert advice.
When visual users look at a map they can easily tell that the controls, attribution, and other (potentially custom) UI components that are placed on the map belong to it. AT users rely on HTML semantics, DOM structure, and ARIA to convey these things and their relationships.
Currently, the
tabindex="0"
,aria-label="Map"
androle="region"
(which together convey the focusable "map component") are set on the<canvas>
which means that any components that are placed outside of it (e.g. themaplibregl-control-container
controls and potential custom UI components) aren't programmatically determinable as related to the map's structure.Notice how in the accessibility tree the button is seemingly not part of any particular semantic structure:
If
tabindex="0"
,aria-label="Map"
androle="region"
were moved from<canvas>
to<div class="maplibregl-map">
the correct structure would be accomplished (and logical focus order guaranteed). However, in this case I suppose thediv
would have to act as a proxy forcanvas
in terms of user input, and probably other things, which might get messy.Another option is to use
aria-owns
which is seemingly widely supported, straight forward to use, and produces the desired result:Although, the number 1 rule of using ARIA is to avoid using ARIA if you can. And there's also the consideration of how
aria-owns
should work with developers' custom UI components.Relates to WCAG 2.1 SC 1.3.1 Info and Relationships.
(The same issue was also reported with MapBox: mapbox/mapbox-gl-js#11038.)
The text was updated successfully, but these errors were encountered: