Page MenuHomePhabricator

Only make map elements focusable that have an interaction
Closed, ResolvedPublic

Description

Following accessibility guidelines we want to change the current behaviour of elements (geoshapes, lines, markers, etc.) in maps to only be reachable via tab or signal an interaction to the mouse cursor if there is an interaction (most likely a popup with further information).

  • markers are only interactive if there is a popup
  • nearby points still are interactive
  • make nearby cluster points that are the center of an expanded spider non-interactive
  • lines
  • polygons
  • geomasks

For review:

Turns out, that the leaflet library that does the geoshapes creation allows overwriting the options for markers but not for the other geoshapes.

We have these 3 4 options:

  1. Live with the different behaviour for markers and geoshapes a.k.a. do nothing.
  2. Update leaflet library to find out if it is fixed. Might be very complex and might not help if the library did no changes in that direction.
  3. Overwrite local mapbox with a hack that changes the interaction behaviour of geoshapes because it is outdated and there will be no updates. (abandoned patch)
  4. Iterated over the existing layers after they were rendered and change the behavior. (implemented)

Event Timeline

Change 886903 had a related patch set uploaded (by Svantje Lilienthal; author: Svantje Lilienthal):

[mediawiki/extensions/Kartographer@master] [WIP] Only make map elements focusable that have an interaction

https://gerrit.wikimedia.org/r/886903

I wonder if this also concerns individual background tiles that recently got blue focus outlines (T315997). Individual tiles don't really have interaction either, do they? If so then these shouldn't be focusable either nor have focus outline, right? At first, till I found respective task, I suspected this new and confusing tile outline is some sort of bug.

Hi, @Pikne. That is an really interesting point. We decided to show the blue rectangle on maps only for keyboard users to make it more visible that the map is currently focused. Possible interaction there are moving the map with the cursor keys and zooming in and out with the +/- keys. I guess that qualifies the focus on the map for the accessiblity guideline. Not completely sure though. I will talk this over with my team. Interestingly other applications solve this differently: e.g. google maps has the blue focus rectangle but open street map does not show one.

Oh, indeed, now that I look closer I realize that this outline is not for a tile. It's fixed to the map centre while tiles aren't, and it's only tile-shaped.

This outline occasionally and unintuitively showed up for me right after opening fullscreen map, I think depending on where I clicked before. But I'm not able reproduce at the moment, so possibly this behaviour has been fixed.

I suppose my commet doesn't concern this task then. Sorry about the confusion.

Change 887744 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/Kartographer@master] [POC] Modify leaflet to only make interactive elements focusable

https://gerrit.wikimedia.org/r/887744

Change 886903 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Only make geopoints focusable that have an interaction

https://gerrit.wikimedia.org/r/886903

Change 888240 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/Kartographer@master] Modify leaflet-markercluster to toggle cluster marker interactive

https://gerrit.wikimedia.org/r/888240

Change 889120 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Kartographer@master] Tab-focus to points/shapes only when they have an interaction

https://gerrit.wikimedia.org/r/889120

Change 889121 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Kartographer@master] Simplify custom pointToLayer callback to use upstream code

https://gerrit.wikimedia.org/r/889121

Change 889121 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Simplify custom pointToLayer callback to use upstream code

https://gerrit.wikimedia.org/r/889121

Change 889120 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Tab-focus to points/shapes only when they have an interaction

https://gerrit.wikimedia.org/r/889120

Change 887744 abandoned by WMDE-Fisch:

[mediawiki/extensions/Kartographer@master] Modify leaflet to only make interactive elements focusable

Reason:

Solved differently without touching upstream.

https://gerrit.wikimedia.org/r/887744

Change 889504 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Kartographer@master] Fix z-index & opacity when tab-navigating clustered markers

https://gerrit.wikimedia.org/r/889504

Change 888240 abandoned by WMDE-Fisch:

[mediawiki/extensions/Kartographer@master] Modify leaflet-markercluster to toggle cluster marker interactive

Reason:

Done differently with new requirements in I7557b377b06d201fd07fa7dad4adf6285af0fad1

https://gerrit.wikimedia.org/r/888240

Change 889504 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Hide the center of a marker cluster when expanded

https://gerrit.wikimedia.org/r/889504