Skip to content

Canvas circleMarker fires 'click' after being draggedΒ #4458

Closed
@balciseri

Description

https://playground-leaflet.rhcloud.com/yaq/edit

Scenario:
Map initialized with preferCanvas: true .
Added a circleMarker

var markerC = L.circleMarker(myCenter2,{radius:30}).bindPopup("popUp");
    map.addLayer(markerC);

Bug: if you start the drag of the map while having the cursor ontop of the circlemarker and you stop the drag with the cursor still on the circleMarker the click event will fire ( i'm just assuming it's a click event) and the popup will open.
This is not the default behaviour, if you set preferCanvas: false this will not happen.
I've found an intresting piece of code https://github.com/Leaflet/Leaflet/blob/master/src/map/Map.js#L969 but i don't know how to fix this for canvas markers.

EDit: the bug occurs also if you don't actually start the drag with the cursor ontop of the marker, it has just to be ontop of the marker when you end the drag

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions