Chart is freezing on mousewheel (infinite loop in DateCategoryAxis.scaleRange)

1 Answer 74 Views
Chart
Greg
Top achievements
Rank 1
Iron
Greg asked on 07 Feb 2022, 08:08 PM | edited on 07 Feb 2022, 08:32 PM

version 2022.1.119

My chart is freezing due to an infinite loop in DateCategoryAxis.scaleRange upon scrolling the mouse wheel over the chart (in an attempt to just scroll the page itself).

I have Zoomable(false) and Pannable(false).

The while condition highlighted below is never false when "delta" is not a positive integer (>= 1) or zero.
In my case, the function was passed delta = 0.3, so the loop iterates 0.3, -0.7, -1.7, -2.7, etc.

            scaleRange: function (delta) {
                var rounds = Math.abs(delta);
                var result = this.range();
                var from = result.min;
                var to = result.max;
                if (from && to) {
                    while (rounds--) {
                        var range = dateDiff(from, to);
                        var step = Math.round(range * 0.1);
                        if (delta < 0) {
                            from = addTicks(from, step);
                            to = addTicks(to, -step);
                        } else {
                            from = addTicks(from, -step);
                            to = addTicks(to, step);
                        }
                    }
                    result = {
                        min: from,
                        max: to
                    };
                }
                return result;
            },

It looks like there are other definitions of scaleRange() that are using the same code that probably would also need fixing.

EDIT:  it appears that the reason "delta" is being passed in as 0.3 is because in the handler Chart._mousewheel:

totalDelta = -1
this$1._mousewheelZoomRate() == 0.3
therefore:  -totalDelta * this$1._mousewheelZoomRate() == 0.3

I haven't dug into the code enough to know whether or not this is an issue, or is expected.

Aleksandar
Telerik team
commented on 09 Feb 2022, 12:18 PM

Hi Greg, 

Can you share the configuration of the Chart so I can try and reproduce the issue. I have tested in this REPL, but have failed in reproducing the issue.

1 Answer, 1 is accepted

Sort by
0
Accepted
Greg
Top achievements
Rank 1
Iron
answered on 14 Feb 2022, 04:12 PM

Thanks to Alexsander for his help.

Updating this post with information he provided in my support ticket:

The issue was reported by another user in GitHub:  https://github.com/telerik/kendo-ui-core/issues/6694

A fix should be in the next release in early March 2022.

Tags
Chart
Asked by
Greg
Top achievements
Rank 1
Iron
Answers by
Greg
Top achievements
Rank 1
Iron
Share this question
or