javascriptreactjsrete

RemoveInput from node Retejs


In my editor, i have defined a type of node that only has inputs. These inputs are dynamically added based on the need of my user. I want to make it possible to dynamically delete these inputs as well.

I am able to retrieve the node id and the input to be deleted id. i am then trying to delete it using

editor.getNode(nodeID).removeInput(inputId);

I am checking that everything exist through some logs but the function removeInput does not seem to be working. I also cannot find anything about it in the documentation but when i type editor.[...] it does propose removeInput so it must mean that it would be possible.


Solution

  • Alright, I fixed it. I was not giving the right input information in the removeInput(input). I had to pass the key index of the input in the inputs array and not the id of the input itself.