If you\'re revisiting this question I\'ve moved all the updates to the bottom so it actually reads better as a question.
I\'ve got a bit o
The problem could be with the rectangle layer too or with the way you call your event suppressor. It may simply cause your keyup event to hang instead of being cancelled so your first key up event returns after the second click. You should implement a counter on your events to verify this theory and return the value of the counter with the event name in the log.
I recently came across this again, and fortunately have managed to isolate the problem and work around it.
It was actually due to something being registered in the mousedown
event, which was moving the DOM element svg:circle
to the top based on a z-order. It does this by taking it out the DOM and re-inserting it at the appropriate place.
This produces something that flows like this:
The problem is, as far as the browser is concerned the mousedown
and mouseup
occurred almost on different elements in the DOM, moving it has messed up the event model.
Therefore in my case I've applied a fix by firing the click
event manually on mouseup
if the original mousedown
occured within the same element.
var events = function(g) {
// Register the raw events required
g.on("mousedown.test", mousedown)
.on("mouseenter.test", mouseenter)
.on("mouseleave.test", mouseleave)
.on("click.test", clicked)
.on("contextmenu.test", contextMenu)
.on("dblclick.test", doubleClicked);
return g;
};
Returning g instead of events might resolve the problem.