jerosoler / Drawflow

Simple flow library 🖥️🖱️
https://jerosoler.github.io/Drawflow/
MIT License
4.41k stars 713 forks source link

Cannot read properties of undefined (reading 'inputs') #851

Open neelphilips opened 2 months ago

neelphilips commented 2 months ago

Hello jerosoler, I hope you are doing well. Any solution for this error for example I have node1 and node2 and now i have tried to delete node 1. so in registerdevents i have removed that node which is node 1 but i have an validation for that lets say due to validation node 1 is not deleteable now i have stored node1 and node2 editor data in another copyobject so now i have again assigned that data to editor. but when i tried to delete that node second time it show me this error in console.

Capture
jerosoler commented 2 months ago

It seems that the deleted node does not exist.

Example of prevent delete node:

neelphilips commented 2 months ago

Thank you for your response. As you have provide me a code in issue number #831 so that is my code so could you helped me out like where to put this prevent deletion code as i am working in angular.

jerosoler commented 2 months ago

Beetween:

editor = new Drawflow(id);
/* CODE HERE */ 
editor.start();