Commit ee23f941 authored by Mike Bostock's avatar Mike Bostock
Browse files

Fix all touches ending on any touch ending.

The drag behavior registers a touchend listener for each started touch; however,
a touchend event is dispatched to ALL listeners when any touch ends, not just
for the corresponding starting touch. The drag behavior must therefore detect
whenever the ending touch is the corresponding starting touch, and ignore other
ending touches.

This fixes the drag behavior during multitouch, as discussed in #1786.
parent 947c6090
......@@ -1164,6 +1164,7 @@
});
}
function ended() {
if (position(parent, eventId)) return;
w.on(move + "." + drag, null).on(end + "." + drag, null);
dragRestore(dragged && d3.event.target === eventTarget);
event_({
......
This diff is collapsed.
......@@ -60,6 +60,7 @@ d3.behavior.drag = function() {
}
function ended() {
if (position(parent, eventId)) return; // this touch still active
w.on(move + "." + drag, null).on(end + "." + drag, null);
dragRestore(dragged && d3.event.target === eventTarget);
event_({type: "dragend"});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment