Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

GraphObject click interrupts double click

$
0
0

@danzrou wrote:

Hello everyone,

I want to be able to call different functions on click and on doubleClick.
My code is as following.
Thing is, click is always called and doubleClick is never fired.
Is there a way to manage this except implementing throttling on my side? (with Rx / setTimeout etc)

Thanks.

$(Panel, 'Spot', {
            name: PlaybookDiagramConstants.CARD_NAME,

            // events
            click: (e: InputEvent, obj: GraphObject) => {
              this.onNodeSingleClick(obj.part.findObject('RootNode') as Part);
            },
            doubleClick: (e: InputEvent, obj) => {
              e.handled = true;
              e.event.preventDefault();
              e.event.stopPropagation();
              const clickedNode = obj.part.findObject('RootNode');
              this.diagram$.zoomToRect(clickedNode.actualBounds, Diagram.Uniform);
              this.hideStepPopover();
            }
...)

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles