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

shapeMouseEnter/Leave problems

1 Answer 53 Views
Map
This is a migrated thread and some comments may be shown as answers.
Seyfor
Top achievements
Rank 1
Seyfor asked on 24 Apr 2016, 09:48 PM

shapeMouseEnter and Leave events are sometimes called, but not always. To repeat this bug, just drag mouse over squares. Sometimes it is painted and sometime it is not.

dojo

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 27 Apr 2016, 07:49 AM
Hello,

This is an SVG-specific behavior caused by the lack of fill on these shape. It can be resolved by applying a fully transparent fill:
style: {
    fill: {
        color: "#fff",
        opacity: 0
    }
}

Same for the toggling code. Here we're using the fill(color, opacity) function:
        shapeMouseEnter: function(e) {
          e.shape.fill("#339fc3", 1);
        },
        shapeMouseLeave: function(e) {
          e.shape.fill("#fff", 0);
        }

See the updated snippet. I'll add this to the documentation for future reference.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Map
Asked by
Seyfor
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or