react-timeline-editor icon indicating copy to clipboard operation
react-timeline-editor copied to clipboard

Add onClickCursor and onDoubleClickCursor events

Open prismosoft opened this issue 2 years ago • 1 comments

Hi @xzdarcy, Great job on this very useful timeline editor, loving it!

Is it possible to add 2 more simple events, onClickCursor and onDoubleClickCursor ?

Here is what's happening:

I am using onClickActionOnly and using the time parameter to set the current time whenever an action is clicked. This works well.

I also use the onDoubleClickAction to trigger something else.

The problem is, on the first click, the time gets updated, and the cursor is being updated and placed just below where the second click is happening. So the double click event is not being triggered, the cursor is being clicked instead. So unless I remove my setTime function from within the onClickActionOnly event, the onDoubleClickAction is being ignored.

So I thought, if you could add events on the cursor as well, I could use those instead. Unless there is another way...

prismosoft avatar Mar 07 '23 18:03 prismosoft

I actually fixed the problem by adding a transition to the cursor! It's actually a nice transition, and the double click works because it happens before the end of the transition 👍

.timeline-editor-cursor {
    transition: left 0.3s;
}

prismosoft avatar Mar 07 '23 18:03 prismosoft