How can the mouse pointer move away from the chart and cancel the dragging state when dragging the chart using the ECharts DataZoom component?

because the mouse pointer leaves the chart without undragging when the DataZoom component in ECharts drags, when the mouse pointer enters the chart again, the chart will follow the pointer even if the left button is not held down.

for example, there is a similar situation in this official demo
http://echarts.baidu.com/exam.

.

generally speaking, if you play similar functions by yourself, you can deal with related problems in events such as mouseleave. However, after looking through the source code of ECharts and ZRender, it seems that ZRender fails to respond to mouseleave, and ECharts does not respond to mouseleave events

.

I don"t know if there is any way to solve this problem. Please do not hesitate to comment

May.11,2021

Why doesn't mine have this effect


manually dispatch a mouseup to canvas element during mouseleave

var mouseEvent= document.createEvent('MouseEvents');
mouseEvent.initEvent('mouseup', true, true);
echartsCanvasEle.dispatchEvent(mouseEvent);
Menu