mudcube/Event.js

Can't cancel event bubbling

Closed this issue · 1 comments

I'm using eventjs to handle desktop and mobile events in a dynamic SVG document. I add event listeners to SVG elements:

    eventjs.add(this.rectNode, "click", function(event, self) {
         ...
         eventjs.cancel(event);
    }

I call eventjs.cancel(event) inside the event handler but it doesn't seem to prevent event bubbling. I have another event handler attached to a different SVG element that is used to pan the map and this handler is fired after the above handler is invoked. Is there something I'm doing wrong?

Thanks

I always find a solution after I post. I moved the event handler to the parent group and changed it from "click" to "mousedown" and it works now. Thanks