Skip to content

Map capturing 'contextmenu' event instead of expected behavior #1730

@taylorhutchison

Description

@taylorhutchison

View this on JSFiddle at: http://jsfiddle.net/thutch/ZzTL7/4/embedded/result/

System: Chrome 27 and IE10 on Windows 7 using Leaflet 0.5.1

Expected Behavior: Either GeoJSON layer would capture 'contextmenu' event before the map when it is between the click origin and the map OR the contextmenu event would fall back to the default action instead of triggering the contextmenu event on the map.

Actual Behavior: Map captures 'contextmenu' event instead of the GeoJSON layer when a popup over the GeoJSON layer is right-clicked.

In my app I bind a 'contextmenu' event to the map. On this event I fetch some GeoJSON from the server and add that feature to the map. I bind a 'contextmenu' event to this GeoJSON feature so as to remove this layer. In almost all test cases this works great. I add a feature with a right-click and can take it away with a right-click. However, if a popup is active and hovering over a GeoJSON layer and I right-click the popup it sends the event to the map rather than the GeoJSON layer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions