This is a migrated thread and some comments may be shown as answers.

Kendo UI v2015.3.930 isScrollable error with context menu attached to SVG

3 Answers 54 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kenneth
Top achievements
Rank 1
Kenneth asked on 21 Oct 2015, 08:16 AM

In the kendo method:

function isScrollable(element) {
        if (element.className.indexOf("k-auto-scrollable") > -1) {
            return true;
        }

        var overflow = getComputedStyles(element, ["overflow"]).overflow;
        return overflow == "auto" || overflow == "scroll";
    }

The element.className is undefined when I right click to open my context menu that is attached to an SVG element.  Can you put some more protection in against an undefined className for the next release please?  I can patch it now but ​I thought it was worth bringing to your attention.

Thanks

 Kenny

3 Answers, 1 is accepted

Sort by
0
Kenneth
Top achievements
Rank 1
answered on 21 Oct 2015, 11:08 AM

I have added a dojo here:

 http://dojo.telerik.com/@koni55/ohoza/2

 If you right click on the grey rectangle you will get a console error​: 12:06:59.201 TypeError: e.className.indexOf is not a function1 kendo.all.min.js:9:2658

But if you right click the "right click" text you get the context menu as expected.

 

Thanks

0
Kenneth
Top achievements
Rank 1
answered on 21 Oct 2015, 11:27 AM

My patch looks like this:

    function isScrollable(element) {
        if (element && element.className && typeof(element.className)==="string" && element.className.indexOf("k-auto-scrollable") > -1) {
            return true;
        }

        var overflow = getComputedStyles(element, ["overflow"]).overflow;
        return overflow == "auto" || overflow == "scroll";
    }

If that helps.

Thanks​

0
Accepted
Iliana Nikolova
Telerik team
answered on 21 Oct 2015, 03:25 PM
Hi Kenneth,

A member of our community reported a similar issue earlier today ( issue). Your patch looks OK and I pushed it as a fix - it will be included in our next internal build. As a small sign of I updated your Telerik points.

Regards,
Iliana Nikolova
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
General Discussions
Asked by
Kenneth
Top achievements
Rank 1
Answers by
Kenneth
Top achievements
Rank 1
Iliana Nikolova
Telerik team
Share this question
or