Dragging a task resizes it

I need to work with a “day” scale, but with “hours” duration. My days have 8 hours.

When I try to move a task inside the same day cell it automatically shrinks the task, if I move it again it is resized again.

Try moving the Task 1 a little bit to the right in the same day as it is in the sample bellow:

https://docs.dhtmlx.com/gantt/snippet/1de3e184

Is there any way to prevent such task resizing?

Hello,
It happens because of the “work_time” option. When it is enabled, gantt doesn’t count the duration of non-working hours leading to stretching or shrinking the tasks. The problem can be solved in two ways.

  1. Turn off the “work_time” option. Tasks won’t be stretched or shrunk, but gantt won’t calculate the working time:
    docs.dhtmlx.com/gantt/snippet/b3995512

  2. Another way is to hide non-working time using “skip_off_time” option. That will change the appearance of the timeline. To make it look like in your snippet you can add an additional scale and use css to hide it:
    docs.dhtmlx.com/gantt/snippet/00887b8d