Dorset-Council-UK / GIFramework-Maps

A .NET based web map built with OpenLayers and Bootstrap
MIT License
15 stars 11 forks source link

Some js links using `href="#"` override the URL when clicked #306

Closed RobQuincey-DC closed 1 month ago

RobQuincey-DC commented 3 months ago

Some JS links in the app with href="#" override the URL (which acts as the map permalink) when clicked. This is likely because the script which does whatever it needs to do does not call e.preventDefault() to prevent the URL from updating to #

Steps to reproduce

Affected links This list is not exhaustive. If you find any others, add it to the list.

Matt-W-DC commented 1 month ago

Fixed this issue for 'collapse all' in the layer control and info click list results in linked branch 'bugfix-link-overrides-URL-306' by adding e.preventDefault().

RobQuincey-DC commented 1 month ago

@Matt-W-DC This is great, thanks. Did you manage to find the one for the Cookie control. Its a funny one to test locally as you need to add some config settings for it to actually appear. I think the code itself is in app.ts line 55