onBeforeDrag and onDragEnd fire twice on double click

Hi,

I’m using timeline view of the scheduler. When I double click on an event the events fired (in order) are as follows:

onBeforeDrag
onDragEnd
onBeforeDrag
onDragEnd
onDblClick

My config is…

scheduler.locale.labels.timeline_tab = "Timeline";
scheduler.locale.labels.section_custom = "Section";
scheduler.config.details_on_create = false;
scheduler.config.details_on_dblclick = false;
scheduler.config.dblclick_create = false;
scheduler.config.xml_date = "%Y-%m-%d %H:%i";
scheduler.config.start_on_monday = true;
scheduler.config.show_loading = true;
scheduler.config.container_autoresize = true;
scheduler.config.drag_resize = false;
scheduler.config.drag_create = false;
scheduler.config.collision_limit = 1;
scheduler.config.mark_now = false;
scheduler.config.prevent_cache = true;
scheduler.config.limit_drag_out = true;

How do I exclude or ignore the drag events when I click or double-click on an event? This is causing confusion between users double-clicking an event and dragging events.

Thanks, Simon

please note that double clicking on an event also fires the onClick event twice.

Hello,
onBeforeDrag and onDragEnd are currently binded to mousedown/mouseup events, so their triggering is expected.
If you need to detect whether actual dragging has happened, you can watch onEventDrag event
docs.dhtmlx.com/scheduler/api__s … event.html
Or check whether event has changed in onDragEnd comparing to it’s original state.
Firing onClick during the double click sequence is also expected, the native onclick and ondoubleclick browser events works the same way

Thanks. I’m now comparing the before and end drag events to detect if the event has changed.

However, it would be much easier to make your component fire these events only where a drag is really happening and when a double-click or click is actually happening etc. This seems more intuitive to me.