Path.bringToFront() removes event listeners in Edge #5238

northlandiguana opened this Issue Jan 9, 2017 · 0 comments


None yet

1 participant

northlandiguana commented Jan 9, 2017 edited
  • [x ] I'm reporting a bug, not asking for help
  • [ x] I've looked at the documentation to make sure the behaviour is documented and expected
  • [x ] I'm sure this is a Leaflet code issue, not an issue with my own code nor with the framework I'm using (Cordova, Ionic, Angular, React…)
  • [x ] I've searched through the issues to make sure it's not yet reported
    (I commented in a merge thread, and @perliedman asked me to open an issue)

How to reproduce

  • Leaflet version I'm using: 1.2
  • Browser (with version) I'm using: Microsoft Edge 38.14393.0.0
  • OS/Platform (with version) I'm using: Windows 10
//Given a GeoJSON FeatureGroup of CircleMarker features:
function onEachFeature(feature, layer) {
        mouseover: highlightFeature,
        mouseout: resetHighlight

function highlightFeature(e) {
    var layer =;

    //BUG: resetHighlight does not fire on mouseout after bringToFront() is called in Edge
    if (map.hasLayer(layer)){

What behaviour I'm expecting and which behaviour I'm seeing

When the path layer is moused over, it should call the highlightFeature() function, and on mouseout should call the resetHighlight() function. After layer.bringToFront() is called in Edge, these listeners appear to be removed; resetHighlight() does not fire on the path and highlightFeature() does not fire again. The issue does not occur if the layer is a raster marker instead of a path layer.

Minimal example reproducing the issue

  • [x ] this example is as simple as possible
  • [x ] this example does not rely on any third party code

Using or any other jsfiddle like site.

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