d3 / d3-drag

Drag and drop SVG, HTML or Canvas using mouse or touch input.

Home Page:https://d3js.org/d3-drag

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reduce the scope of default behavior prevention.

mbostock opened this issue · comments

Currently, we register selectstart, dragstart and click preventers on all drag gestures. However, it’s only necessary to prevent these events on mouse-based drag gestures. A click event is only emulated on touch if the (single) finger doesn’t move between touchstart and touchend, so there’s no reason to suppress the click event after a touch gesture. Furthermore, it doesn’t look like selectstart or dragstart is necessary to prevent, either.