highcharts / draggable-points

MIT License
32 stars 34 forks source link

Single clicking a point will make the point follow the mouse #77

Closed basvangeffen closed 6 years ago

basvangeffen commented 6 years ago

The latest commit caused this issue: a single click on a point will result in that point following the mouse (as if dragging). The problem seems to be caused by the "Reset" line in the drop function.

dragPoint = dragX = dragY = undefined; is only executed if "newPos" is truthy, which it is not if you click a point (with default dragSensitivity).

TorsteinHonsi commented 6 years ago

Thanks! It should work now. It resets if the newPos is falsy, otherwise if the drop is not cancelled. That leaves the opportunity to cancel the drop.