Closed ZachMilne closed 6 years ago
Thank you for the suggestion.
At this moment it's possible to unbind Highcharts events in chart.events.load
callback, for example: https://jsfiddle.net/15xkuykt/
chart: {
renderTo: 'container',
events: {
load: function() {
Highcharts.removeEvent(
this.container,
'mouseleave',
Highcharts.grep(
this.container.hcEvents.mouseleave,
function(fun) {
return this.name === 'drop'; // draggable point adds "drop" function
}
)[0]
);
}
}
},
The only problem is that index for mouseleave
I just did a change I've been planning already - to allow returning false from the drop
event handler to cancel the drop. Now you can check the event arguments to cancel in your case:
if (e.originalEvent.type === 'mouseleave') {
return false;
}
That will work well. Thanks for the quick responses and implementation.
If the mouse inadvertently leaves the chart container while dragging, an undesirable drop event occurs. I propose a dropOnMouseleave option. Default: true