G6
G6 copied to clipboard
[Bug]: Node click events not fired and causes screen crash in Nuxt.js app
Describe the bug / 问题描述
I built a simple interactive graph visualization that works well in React.js, but it doesn’t work in Nuxt.js because node click events are not fired and subsequent click events cause the Nuxt.js app to crash.
Reproduction link / 复现链接
https://github.com/dianaow/ANTVG6-NUXT
Steps to Reproduce the Bug or Issue / 重现步骤
- Clone github repo
- npm install
- npm run dev
- open url on browser and click on any node
(Sorry, nuxt.js starter on stackblitz is faulty and codesandbox doesn't have a nuxt.js environment)
Version / 版本
🆕 5.x
OS / 操作系统
- [x] macOS
- [ ] Windows
- [ ] Linux
- [ ] Others / 其他
Browser / 浏览器
- [x] Chrome
- [ ] Edge
- [ ] Firefox
- [ ] Safari (Limited support / 有限支持)
- [ ] IE (Nonsupport / 不支持)
- [ ] Others / 其他
I have tried debugging with the Behaviour Controller where pointerdown, pointerup and click events should be emitted in sequence after browser click on a node through forwardCanvasEvents. However, the click is not emitted for Nuxt.js (no CommonEvent.CLICK event forwarded), but does so in a Next.js demo.
//line 101-104
if (!(type === CommonEvent.CLICK && button === 2)) {
graph.emit(`${targetType}:${type}`, stdEvent);
graph.emit(type, stdEvent);
}