mbostock/d3 — Issue #391: drag inhibits mouseup
Author: biovisualize
Created: 2011-11-27 07:03:40+00:00
State: open

I need to bind a mouseup and a drag on the same selection to be able to discriminate between a mouseup after a drag (dragend) or not (mouseup). This pattern worked with 2.4.6 but seems broken in 2.6.0. Mousedown is still working. Here is an example:

d3.select("body").append("svg:svg")
.append("svg:rect")
.attr("width", 100)
.attr("height", 100)
.attr("fill", "red")
.on("mouseup", mouseup)
.call(d3.behavior.drag()
.on("drag", drag));

function drag(){
console.log("working");
}

function mouseup(){
console.log("non-working in 2.6.0");
}

Do you want me to test further?