Using Leaflet v1.0.3 release, e.g. with Firefox 51.0.1 & Chrome 55:
If a polyline and the map have click event handlers,
both event handler functions will be called when polyline got clicked by user.
Expected behavior is that only the polyline's handler function is getting called.
This is expected, because the last version I tried (Leaflet v0.7.7 release) shows
that behavior and even Leaflet v1.0.3 release acts this way, if a marker is clicked
instead of a polyline.
Please take a look at this example: https://jsfiddle.net/rno4htgr/18/
Calling L.DomEvent.stopPropagation(e); inside polyline's click event handler is a workaround.
Expected behavior is that only the polyline's handler function is getting called.
No.
The expected behaviour is that layer events get propagated to the map (through any layergroups they might be a part of). This happens since https://github.com/Leaflet/Leaflet/pull/3307 .
See also https://github.com/Leaflet/Leaflet/pull/4883 .
Thanks for the quick reply and sorry for the noise!
No prob :-)
Most helpful comment
No.
The expected behaviour is that layer events get propagated to the map (through any layergroups they might be a part of). This happens since https://github.com/Leaflet/Leaflet/pull/3307 .
See also https://github.com/Leaflet/Leaflet/pull/4883 .