gantt icon indicating copy to clipboard operation
gantt copied to clipboard

Disable vertical autoscroll

Open kansimies opened this issue 1 year ago • 1 comments

Is there a way to prevent vertical autoscroll? I have a use case where I might have a lot of rows in the gantt chart with click_drag enabled. If the user starts to click_drag at the bottom of the viewport the autoscroll starts to scroll down very easily.

Snippet here: https://snippet.dhtmlx.com/xfmowux0

kansimies avatar Jan 21 '25 14:01 kansimies

@kansimies, There is the autoscroll config: https://docs.dhtmlx.com/gantt/api__gantt_autoscroll_config.html

When it is disabled, Gantt doesn't scroll the timeline when the mouse is near the edge of the container.

You can disable that config in the onBeforeDrag event handler and enable it in the callback function:

function onDragEnd() {
    console.log("jee")
    gantt.config.autoscroll = true;
}

gantt.$task_data.attachEvent("onBeforeDrag", function (coords) {
    gantt.config.autoscroll = false;
});

https://docs.dhtmlx.com/gantt/desktop__advanced_dnd.html#:~:text=fires%20after%20pressing%20the%20mouse%20button%20before%20starting%20to%20drag

Here is an example in the snippet: https://snippet.dhtmlx.com/6bp4wdl4

gearcoded avatar Jan 27 '25 16:01 gearcoded