mouseup 鼠标事件丢失
summer123123123 opened this issue · comments
Version
5.5.0
Link to Minimal Reproduction
1
Steps to Reproduce
鼠标松开时,mouseup事件偶尔丢失,没有打印信息
const refElecChart = ref()
const initEvent = () => {
const chart = refElecChart.value?.myCharts
// 鼠标移动
chart && chart.getZr().on('mousemove', (params: any) => {
console.log('mousemove')
const pointInPixel = [params.offsetX, params.offsetY]
if (chart.containPixel('grid', pointInPixel)) {
const areaIndex = chart.convertFromPixel({ seriesIndex: 0 }, pointInPixel)[0]
emit('click-chart', areaIndex)
}
})
// 鼠标松开
chart && chart.getZr().on('mouseup', () => {
console.log('mouseup')
emit('click-chart')
})
}
Current Behavior
鼠标松开时,mouseup事件偶尔丢失,没有打印信息
const refElecChart = ref()
const initEvent = () => {
const chart = refElecChart.value?.myCharts
// 鼠标移动
chart && chart.getZr().on('mousemove', (params: any) => {
console.log('mousemove')
const pointInPixel = [params.offsetX, params.offsetY]
if (chart.containPixel('grid', pointInPixel)) {
const areaIndex = chart.convertFromPixel({ seriesIndex: 0 }, pointInPixel)[0]
emit('click-chart', areaIndex)
}
})
// 鼠标松开
chart && chart.getZr().on('mouseup', () => {
console.log('mouseup')
emit('click-chart')
})
}
Expected Behavior
鼠标松开时,mouseup事件偶尔丢失,没有打印信息
const refElecChart = ref()
const initEvent = () => {
const chart = refElecChart.value?.myCharts
// 鼠标移动
chart && chart.getZr().on('mousemove', (params: any) => {
console.log('mousemove')
const pointInPixel = [params.offsetX, params.offsetY]
if (chart.containPixel('grid', pointInPixel)) {
const areaIndex = chart.convertFromPixel({ seriesIndex: 0 }, pointInPixel)[0]
emit('click-chart', areaIndex)
}
})
// 鼠标松开
chart && chart.getZr().on('mouseup', () => {
console.log('mouseup')
emit('click-chart')
})
}
Environment
- OS:
- Browser:
- Framework:
Any additional comments?
No response