peaks.js icon indicating copy to clipboard operation
peaks.js copied to clipboard

only one of dblclick or click event is triggered

Open coleea opened this issue 2 years ago • 4 comments

version : 3.0.0-beta.8

when I double-click in zoomview, Sometimes only one of dblclick or click event is triggered.

Sometimes both dblclick and click event triggered. But sometimes only one of dblclick or click event is triggered. I don't know by which condition the only one event is triggered.

I attach a video. in this video, console.log on chrome devtools outputs each event

https://user-images.githubusercontent.com/7471674/228110472-75c609c4-9080-49f4-ad15-ee8244523522.mp4

Clicking on a particular timeline triggers only one of click and dblclick I don't know why both click and dblclick won't trigger

You can test via https://rumpus-six.vercel.app/

And if this is a bug, I want to fix this. I would appreciate it if you could let me know which source code I should refer to

coleea avatar Mar 28 '23 02:03 coleea

You are very welcome to try to fix this. Peaks.js listens for click and dblclick events from Konva, here for example. So you may also need to look at how Konva generates these events.

chrisn avatar Mar 28 '23 10:03 chrisn

I have not been able to reproduce this problem, using the demo pages.

If I double-click on a segment, I see these events:

segments.click: {segment: Segment, evt: MouseEvent}
zoomview.click: {time: 27.028027210884353, evt: MouseEvent}
segments.dblclick: {segment: Segment, evt: MouseEvent}
zoomview.dblclick: {time: 27.028027210884353, evt: MouseEvent}

When I double-click where there is no segment, I see these events:

zoomview.click: {time: 35.48009070294785, evt: MouseEvent}
zoomview.dblclick: {time: 35.48009070294785, evt: MouseEvent}

chrisn avatar Mar 29 '23 20:03 chrisn

@chrisn thank you for answer. I will check demo and create new project for testing

coleea avatar Apr 03 '23 12:04 coleea

In case it helps, I think that the relevant code in Konva that generates click and dblclick events is here.

chrisn avatar Apr 04 '23 09:04 chrisn