ONSvisual/maptemplates

Deselect with keyboard control bug

Opened this issue · 6 comments

When you select an area on the map and click the cross to deselect, the area's value is removed from the key, the area's outline disappears and the map zooms out to view the whole country.

When you select an area on the map and use keyboard controls to navigate to the cross and deselect, the area's value remains on the key along with the area's outline on the map, with no change in zoom.

image

looks like this is quite easy to fix, just need to call the resetZoom and hideaxisval functions

I think you should have used onLeave instead of hideaxisval? It calls hideaxisval and also removes the black geographical outline.

Was the removal of button unrelated?

Ah good point about onleave. Yeah I was getting rid of the button as that was my previous attempt to make the abbr have keyboard events and it's not needed

You can even just use onLeave and resetZoom

image