G6 icon indicating copy to clipboard operation
G6 copied to clipboard

TreeGraph使用changeData改变数据后,触发了图上绑定的事件报错

Open augustaba opened this issue 9 months ago • 2 comments

问题描述

当我试图拖拽一个节点到树图的另一个节点下时,使用changeData改变了数据后。由于我节点上绑定了鼠标mouseleave等事件,当触发了mouseleave里的updateItem方法,报错了,有什么解法吗?

重现链接

https://codesandbox.io/p/sandbox/g6-test-yts46l?file=%2Fsrc%2FApp.tsx%3A71%2C22

重现步骤

  1. 在codesanbox中预览页面
  2. 直接在画布中拖拽任一节点
  3. 鼠标移动几下
  4. 报错了

预期行为

期望有什么办法可以不报错

平台

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

屏幕截图或视频(可选)

image

补充说明(可选)

No response

augustaba avatar Nov 28 '23 05:11 augustaba

hi @augustaba, welcome!

github-actions[bot] avatar Nov 28 '23 05:11 github-actions[bot]

Hi @augustaba, Please star this repo if you find it useful! Thanks :star:! 你好 @augustaba。如果该仓库对你有用,可以 star 一下,感谢你的 :star:!

github-actions[bot] avatar Nov 28 '23 05:11 github-actions[bot]