antvis/G6

自定义 Behavior中,getEvents函数设置了"node:mousemove": "move"之后,影响了节点的拖拽 #4626

menghaoG posted onGitHub

问题描述

在文档的“节点内容可滚动”示例中发现该问题,注释了第129行的代码之后,节点才可以拖拽 image

重现链接

https://g6.antv.antgroup.com/examples/item/customNode#scrollNode

重现步骤

1.示例中的节点已配置了拖拽 2.节点无法拖拽 3.注释第129行自定义move交互事件 4.节点可拖拽

预期行为

自定义move交互事件时,不影响节点的拖拽事件

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]
  • G6 版本: [4.5.1 ... ]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


感谢报告,我来修改一下 demo。

应该是因为 move 函数里面频繁调用 updateItem ,和 drag 过程中也是频繁调用 updateItem 来更新坐标,相互冲突覆盖了。这样处理一下即可:

<img width="362" alt="image" src="https://github.com/antvis/G6/assets/29593318/0023fdc6-49ca-4ad9-830d-10cd2b130391">

posted by Yanyan-Wang almost 2 years ago

首次加载后可以拖拽,但再次拖拽会报错 image

posted by menghaoG almost 2 years ago

Fund this Issue

$0.00
Funded

Pull requests