Vertical drag is not working properly


Even after unsuccessful drag it is replicating the the taskbar. how can i fix this? how to give more accuracy to the drag function
video for reference : -


Hello Nitish,
Gantt doesn’t have a built-in feature to vertically reorder tasks in the timeline. In the snippet, you only have an example of the implementation, so it is expected that it may not work correctly in every use case.

There are 2 ways why duplicate tasks may be created.

  1. The task is moved to the same vertical position. That can be easily fixed if we cancel the drag and don’t use the code to create a new task:
      if (id == {
        dragging_task = 0;

Here is the updated snippet:
2) When you move a task to a task row that has the task type, the target task becomes the project task. The initial target task is cloned and displayed as the split task. When you move all tasks from that row, the project task becomes a regular task. You need to decide if you want to delete that task or not.
If you want to do that, you need to check the number of child tasks after a timeout and delete that task if it doesn’t have any children:

        if (children.length == 1) {
          original_parent.type = gantt.config.types.task;
            if (!gantt.hasChild( {
          }, 20)

Here is the snippet:

Please, note, that it is still not an ideal solution, and you may encounter some issues in the different use cases.