projectstorm / react-diagrams

a super simple, no-nonsense diagramming library written in react that just works
https://projectstorm.cloud/react-diagrams
MIT License
8.46k stars 1.16k forks source link

LinK doesn't delete when it's not connected to a target port #895

Closed DaSilvaRemi closed 2 years ago

DaSilvaRemi commented 2 years ago

Hello @dylanvorster , and all devs

On LinkModel.js the link doesn't delete on the port if it is not connected to the target port.

Original Code remove() { if (this.sourcePort) { this.sourcePort.removeLink(this); } if (this.targetPort) { this.targetPort.removeLink(this); } super.remove(); }

My solution remove() { if (this.sourcePort) { this.sourcePort.removeLink(this); } if (this.targetPort) { this.targetPort.removeLink(this); } super.remove(); delete this; }

DaSilvaRemi commented 2 years ago

I add some precision to my last issue. This issue id due when a user delete a link by it's final point, so it doesn't suppress the link.

I test my solution and it"s working

malavshah9 commented 2 years ago

@DaSilvaRemi Yes, If that is working than you can close this issue.

Thanks!!

DaSilvaRemi commented 2 years ago

@DaSilvaRemi Yes, If that is working than you can close this issue.

Thanks!!

Hello, I want the creator of the project storm to publish my modif