How to select also the following nodes after a selection?

111 views Asked by At

I'm currently trying to also select the child edges and child nodes, when selecting a node. I tried the following function:

cy.on('tap', 'node', function(event){
    this.outgoers().select();
}

But it seems that i can't get it to work with 'tap'. I also tried with 'select' which does work, but all the child nodes until the leaves are selected (which was expected).

Is there a way to implement this with 'tap' or can the recursive calls from 'select' be limited somehow?

Thanks in advance

1

There are 1 answers

0
maxkfranz On BEST ANSWER

Option 1: Put your .select() call in a timeout. It seems the default selection event is overriding your previous call.

Option 2: Bind to 'select' so you know that the default selection event has already happened.