Vertical Scroll bar is automatically scrolling

Hi Team,
I am using below code snippet to highlight complete Gantt row on hover but when I click on any task from grid and move mouse curser to any other task vertical scroll bar starts moving slowly.
Even on click also it moves a little.

My observations : gantt.refreshTask/click event is triggering scroll- bar event.
Is there any way to stop it ?

gantt.$highlight_id = null;
gantt.attachEvent("onMouseMove", function (id, e) {
    if ((!id && gantt.$highlight_id) || (id && gantt.$highlight_id && (id != gantt.$highlight_id))) {
        gantt.batchUpdate(function () {
            gantt.eachTask(function (task) {
                if (task.$highlighted) {
                    task.$highlighted = false;
                }
            })
        })
        gantt.$highlight_id = null;
    }

    if (id) {
        var hover_task = gantt.getTask(id);
        if (!hover_task.$highlighted) {
            hover_task.$highlighted = true;
            gantt.refreshTask(id)
        }
        gantt.$highlight_id = id;
    }
    
    else {
        if (e.target.closest('[data-task-id]') && e.target.closest('.gantt_task_row')) {
            const taskElement = e.target.closest('[data-task-id]');
            const taskId = taskElement.getAttribute('data-task-id');

            if (taskId) {
                const hoverTask = gantt.getTask(taskId);

                if (!hoverTask.$highlighted) {
                    hoverTask.$highlighted = true;
                    gantt.refreshTask(taskId);
                }
                gantt.$highlight_id = taskId;
            }
        }
    }
});

Hello Amit,
I tried adding this code to the following snippet:
https://snippet.dhtmlx.com/ri1b3mth

I cannot reproduce the issue with the vertical scrollbar, but it is reproduced with the horizontal scrollbar. And it is reproduced only for some specific tasks, for others, it is not reproduced.
However, the code you shared should be from an old snippet that repaints the all tasks on the screen.

There is a better approach from the newer snippet that repaints only the relevant tasks:

I cannot reproduce the issue when I add the code to the snippet with a lot of tasks:
https://snippet.dhtmlx.com/e5mymi09

However, I reproduced the scrollbar issue in the following snippet even without the code you shared by calling the render method after selecting some tasks:
https://snippet.dhtmlx.com/zrifxqu5

It seems to be working that way even with the 5.1 version. But I cannot reproduce the bug in Firefox and older Chrome versions (119.0.6045.105 and older). Also, when I tried the 120 version, the issue wasn’t reproduced. So, probably, it is a Chrome-related bug that will be fixed in the future updates.