Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graph监听鼠标双击会多次触发单击事件 #3558

Closed
willYang1215 opened this issue May 4, 2023 · 4 comments
Closed

graph监听鼠标双击会多次触发单击事件 #3558

willYang1215 opened this issue May 4, 2023 · 4 comments

Comments

@willYang1215
Copy link

问题描述

node:dbclick会多次触发node:click
定时器只能解决多次的问题
有没有人知道双击触发单击事件怎么解决

重现链接

https://stackblitz.com/edit/vue-ccyk8n?file=src%2FApp.vue

重现步骤

graph.value.on("cell:dblclick", ({ cell }) => {
clearTimeout(timeOut)
console.log(’这里是双击事件‘)
});
graph.value.on('cell:click', ({ cell }) => {
clearTimeout(timeOut)
timeOut = setTimeout(()=>{
console.log(’这里是单击事件‘)
},200)
})

预期行为

双击不要触发单击事件

平台

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

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

@x6-bot
Copy link
Contributor

x6-bot bot commented May 4, 2023

👋 @willYang1215

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.
We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@willYang1215
Copy link
Author

timeOut

@ajesses
Copy link

ajesses commented Jun 27, 2023

节点双击事件也会触发该节点的单击事件
image

例子链接:https://codesandbox.io/s/dawn-sky-vnj525
怎么只触发双击事件呢?

@x6-bot
Copy link
Contributor

x6-bot bot commented Jun 27, 2024

This thread has been automatically locked because it has not had recent activity.

Please open a new issue for related bugs and link to relevant comments in this thread.

@x6-bot x6-bot bot locked as resolved and limited conversation to collaborators Jun 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants