jerosoler / Drawflow

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

drawflow removeNodeOutput QuerySelector Issue #528

Closed cheesama closed 2 years ago

cheesama commented 2 years ago

Hi, before reporting issue, I appreciate you about this great library development.

When I try to use drawflow editor.removeNodeoutput Function, It seems to set wrong query selection in code.

Here is actual DOM elements.

image

But, there is wrong part in lib code.

image

following this code, wrong reference dom element is searched and not found finally.

image

When I modified querySelector slightly like below, it works

image

So, how about it? Can you fix it or may I do pull request for it?

Thank you~

jerosoler commented 2 years ago

Hi! @cheesama

The second value has to be the complete class and not the id of the output. Exemple: "output_2" not "2"

In docs: https://github.com/jerosoler/Drawflow#methods

Mehtod Description
removeNodeOutput(id, output_class) Remove output to node. Ex id: 5, output_2

The code is example in demo:

editor.removeNodeOutput(12, 'output_2');

image

cheesama commented 2 years ago

Thank you for reply.

Following your guide, it works well. Sorry for misuse of lib.

I close this issue myself ^^