If you’re a bit fast when you start dragging after clicking to create an event (i.e. if you act normally and don’t intentionally wait after clicking before you start dragging), the event does not start where you clicked but later.
// position of the mouse moved event
var pos=this._mouse_coords(e);
// ...
// replace the position of the start of the drag by the position of the first mouse moved event
this._drag_pos=pos;
this._drag_pos.has_moved = true;
// ...
// calculate the start date from the replaced position
start = this._get_date_from_pos(pos).valueOf();
I think that this._drag_pos=pos is unnecessary, and that the start date should be calculated from the original drag position (mouse down position):
var pos=this._mouse_coords(e);
// ...
// don’t change the position of the start of the drag
this._drag_pos.has_moved = true;
// ...
// calculate the start date from the mouse down position
start = this._get_date_from_pos(this._drag_pos).valueOf();
If you’re a bit fast when you start dragging after clicking to create an event (i.e. if you act normally and don’t intentionally wait after clicking before you start dragging), the event does not start where you clicked but later.
That’s because in
scheduler._on_mouse_move
, you calculate the start date from the position of the mouse move event instead of the position of the mouse down event (https://github.com/DHTMLX/scheduler/blob/master/codebase/sources/dhtmlxscheduler.js#L2377):I think that
this._drag_pos=pos
is unnecessary, and that the start date should be calculated from the original drag position (mouse down position):