Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable vertical autoscroll #138

Open
kansimies opened this issue Jan 21, 2025 · 1 comment
Open

Disable vertical autoscroll #138

kansimies opened this issue Jan 21, 2025 · 1 comment

Comments

@kansimies
Copy link

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

@gearcoded
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants