Improve accessibility of marker clusters

Created on 29 July 2024, 5 months ago
Updated 14 August 2024, 4 months ago

Problem/Motivation

It's possible to use a Leaflet map using keyboard navigation, for example by pressing "tab" repeatedly you can iterate through the markers on the map, and press the "enter" key to open the info window for each marker. However, it's not possible to expand a marker cluster by pressing enter.

Steps to reproduce

Browse to https://www.geodemocracy.com/drupal_geofield_stack_demo/web/geoplaces-ma... and press tab to iterate through the markers on the map. Press enter when a single marker is selected and you'll see that the Info window opens as expected. Continue tabbing through to select a marker cluster, press enter and you'll see that nothing happens. The improved behaviour would be for Enter to open the marker cluster e.g. https://leaflet.github.io/Leaflet.markercluster/example/marker-clusterin....

Proposed resolution

This has been resolved in the Leaflet Marker Cluster library - https://github.com/Leaflet/Leaflet.markercluster/issues/940 so updating to a more recent version of Marker Cluster resolves this. I've sandboxed this locally using https://github.com/Leaflet/Leaflet.markercluster/releases/tag/v1.5.3 and it behaves as required.

Remaining tasks

Secondary testing by someone who knows this module better than I do.

User interface changes

None.

API changes

None.

Data model changes

None.

📌 Task
Status

Fixed

Version

10.2

Component

Code

Created by

🇬🇧United Kingdom billy.davies

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024