Stop propagation of click events to leaflet

GoJS over leaflet. I have several Parts in the Tool layer (legend, buttons…) The diagram’s nodes and links on lower layers respond to clicks those buttons and panels above, but logically should be stopped. Is there an elegant way of stopping the propagation?



Adding a bit more detail…

Let’s say I have a button on the Tool layer like:


$(go.Part, "Auto", { locationSpot: go.Spot.BottomLeft, layerName: "Tool", selectable: true , click: function(e, obj, prev) { // change group's background brush console.log("click"); }, location: new go.Point( this.theDiagram.viewportBounds.left+10, midpointY )

The click handler does not get executed. The map underneath does pick up the click though. I’m wondering what interaction I’m missing?

P.S. The mouseEnter action did get executed when I tried it, so seems to be only the click actions.

Yes, that’s intentional – you normally don’t want objects in layers like “Tool” to respond to clicks.

But if you do, you can set GraphObject.isActionable to true. Buttons do that, for example – see – so that a Button in an Adornment will work.

great. That worked like a charm. Thanks Walter.