Can't cancel adding connector on collectionChange

Hi

I'm writing app using syncfusion diagram. I have problem while trying to cancel adding Connector. I'm subscribing collectionChange method and using event.cancel = true, but it doesn't work. What's strange, when I comment if statement, it works. Here's stackblitz.

Thank you
Jan Jakubowski

1 Reply 1 reply marked as answer

AR Aravind Ravi Syncfusion Team June 25, 2020 05:10 AM UTC

Hi Jan, 
 
We have modified a sample to cancel the connector through collection change event. In the event state Changing only we can able to cancel the connector that gets added. Please find the below code snippet for how to cancel the connector in the Changing state. 
 
this.diagram.collectionChange.subscribe(event => { 
      if(event.element && event.type === 'Addition' && event.state === 'Changing' ) { 
          console.log('CANCEL'); 
          event.cancel = true; 
      } 
       
    }) 
 

Regards 
Aravind Ravi 


Marked as answer
Loader.
Up arrow icon