Question

I've next code:

vis.forceRep.circle.enter()
    .append("g")
    .attr("class", "cRepo")
    .attr("transform", tr)

    .on("mouseover.select", vis.meRepo)
    .on("mouseout.select", vis.mlRepo)

    .on("mousemove.mtt", vis.mtt)

    .on("click.select", vis.clRepo)

    .call(vis.forceRep.drag)
;

Into v3.1 we've got the following behavior:

  • Dragging is not select a node. (MouseDown -> MouseMove -> MouseUp).
  • Click is select a node. (MouseDown -> MouseUp).

Now into v3.2+:

  • Drag == Click. That is after dragging after MouseUp.drag the Click event is raised.

How to fix it?

Was it helpful?

Solution

Solution is

vis.clRepo = function() {
    if (d3.event.defaultPrevented)
        return;
    /* handle the click event */
}

found in this answer

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top