antvis/G6not sure if it only involve

Do you want to work on this issue?
You can request for a bounty in order to promote it!
[Bug]: Event trigger issues for zoom-canvas #6841
Rey-Wang posted onGitHub
Describe the bug / 问题描述
not sure if it only involve zoom-canvas
behavior, when the left mouse button is pressed and dragged across the canvas , then zoom-canvas not worked any more
用下面的配置,用鼠标左键在canvas 上画一下,然后zoom-canvas就不能被触发了
behaviors: [
{
type: 'scroll-canvas',
enable: (event) => {
console.log('scroll', !event.ctrlKey&&!event.metaKey);
return !event.ctrlKey && !event.metaKey;
},
preventDefault: true,
},
{
type: 'drag-canvas',
enable: (event) => event.buttons === 4,
},
{
type: 'zoom-canvas',
enable: (event) => {
console.log('zoom',event.ctrlKey || event.metaKey);
return event.ctrlKey || event.metaKey;
},
preventDefault: true,
},
],
Reproduction link / 复现链接
No response
Steps to Reproduce the Bug or Issue / 重现步骤
https://github.com/user-attachments/assets/6e262af6-9a59-486e-96bc-51c6eaa27ca6
https://www.loom.com/share/aef43b948f0f4ed9855be2332257095e?sid=c03dcc64-c16f-47b0-8050-248671101d65
Version / 版本
🆕 5.x
OS / 操作系统
- macOS
- Windows
- Linux
- Others / 其他
Browser / 浏览器
- Chrome
- Edge
- Firefox
- Safari (Limited support / 有限支持)
- IE (Nonsupport / 不支持)
- Others / 其他