From 0b97d2bd303a5753f2f6988389256252b4234d8c Mon Sep 17 00:00:00 2001 From: Zarino Zappia Date: Mon, 17 Jan 2022 15:17:51 +0000 Subject: [PATCH] Make map pan/zoom controls keyboard-accessible Removes `aria-hidden` from `#map_box`, but adds it back onto the map image tiles and pins, to allow keyboard and assistive device users to tab through the map controls without having to wade through potentially hundreds of map markers. After the map controls, keyboard focus passes to the links, form filters, and list of reports in `#map_sidebar`. Fixes mysociety/societyworks#2803. --- CHANGELOG.md | 1 + templates/web/base/maps/noscript_map.html | 4 ++-- templates/web/base/maps/noscript_map_base_wmx.html | 4 ++-- templates/web/base/maps/openlayers.html | 2 +- templates/web/zurich/maps/noscript_map.html | 8 ++++---- web/js/map-OpenLayers.js | 9 +++++++++ web/js/map-OpenStreetMap.js | 2 +- web/js/map-bing-ol.js | 2 +- web/js/map-cheshireeast.js | 2 +- 9 files changed, 22 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85d00ce7f83..044225e845f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Bugfixes: - Add ID attributes to change password form inputs. - Fix link deactivation for privacy policy link on privacy policy page. #3704 + - Make map pan/zoom controls keyboard-accessible. #3751 - Admin improvements: - Admin 'add user' form now always creates staff users - Development improvements: diff --git a/templates/web/base/maps/noscript_map.html b/templates/web/base/maps/noscript_map.html index 0b7431148d5..91e986c484b 100644 --- a/templates/web/base/maps/noscript_map.html +++ b/templates/web/base/maps/noscript_map.html @@ -1,6 +1,6 @@ [% SET start = c.config.ADMIN_BASE_URL IF admin -%]
-
+ -
[% FOR pin IN map.pins %][% INCLUDE 'maps/pin.html' %][% END %]
+ [% INCLUDE 'maps/_compass.html' %]
diff --git a/templates/web/base/maps/noscript_map_base_wmx.html b/templates/web/base/maps/noscript_map_base_wmx.html index 45de9926e0b..19078ec9c5c 100644 --- a/templates/web/base/maps/noscript_map_base_wmx.html +++ b/templates/web/base/maps/noscript_map_base_wmx.html @@ -1,5 +1,5 @@
-
+ -
[% FOR pin IN map.pins %][% INCLUDE 'maps/pin.html' %][% END %]
+ [% INCLUDE 'maps/_compass.html' %]
diff --git a/templates/web/base/maps/openlayers.html b/templates/web/base/maps/openlayers.html index 5f5a5ce4e8d..8699980bbf1 100644 --- a/templates/web/base/maps/openlayers.html +++ b/templates/web/base/maps/openlayers.html @@ -39,7 +39,7 @@ [%- END -%] >
-