You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment if you drag multiple draggables at the same time on phone they stack on top of each other. The reason is that if multiple touch move event happen in the same frame, then they all are pushed in TouchList array and they are accessible to each touchmove event. The problem is in position model, fromEvent function, the coordinates are always from the 1st element in the array:
return new Position(e.changedTouches[0].clientX, e.changedTouches[0].clientY);
So the 2nd draggable sets its position to 1st draggable position and they overlap, the solution can be to check if the target is correct, something like this:
for (let i = 0; i < e.changedTouches.length; i++) {
if (e.changedTouches[i].target === e.target) {
return new Position(e.changedTouches[i].clientX, e.changedTouches[i].clientY);
}
}
return new Position(0, 0); // I don't know if this can happen
The text was updated successfully, but these errors were encountered:
At the moment if you drag multiple draggables at the same time on phone they stack on top of each other. The reason is that if multiple touch move event happen in the same frame, then they all are pushed in TouchList array and they are accessible to each touchmove event. The problem is in position model, fromEvent function, the coordinates are always from the 1st element in the array:
return new Position(e.changedTouches[0].clientX, e.changedTouches[0].clientY);
So the 2nd draggable sets its position to 1st draggable position and they overlap, the solution can be to check if the target is correct, something like this:
The text was updated successfully, but these errors were encountered: