maptemplates icon indicating copy to clipboard operation
maptemplates copied to clipboard

Deselect with keyboard control bug

Open giacomobg opened this issue 4 years ago • 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

giacomobg avatar Sep 15 '20 10:09 giacomobg

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

henryjameslau avatar Sep 15 '20 12:09 henryjameslau

e.g. https://github.com/ONSvisual/maptemplates/commit/d3f40f83e69f26e19a4ad0feea7f6bc20821558d

henryjameslau avatar Sep 15 '20 12:09 henryjameslau

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

giacomobg avatar Sep 15 '20 13:09 giacomobg

Was the removal of button unrelated?

giacomobg avatar Sep 15 '20 13:09 giacomobg

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

henryjameslau avatar Sep 15 '20 13:09 henryjameslau

You can even just use onLeave and resetZoom

image

henryjameslau avatar Sep 15 '20 13:09 henryjameslau