I want to config only one flow between two elements. I was tried setup Rule provider with below code, it worked, but when I reconnect connection it has no effect.
Hope anyone help, thank you so much!
I just want maximum 1 connections between 2 elements(same direction). My code worked when I create new connection, but when I change target from another element it does not work.
The reason your reconnection logic doesnât work is that you condition is true when the reconnection is initiated, not giving it a chance to change targets.
You should not run your check when the ânewâ target is the current target of the connection.
When I tried the code you provided, it worked when I moved the arrowhead of the connection. However, when I moved the source of the connection, it did not satisfy the condition connection.target.id === target.id, so I was still able to connect(which is incorrect).
Sorry about my English,
I just mean the code worked when I moved the arrowhead of the connection. However, when I moved the source of the connection, it did not. https://codesandbox.io/p/devbox/nervous-wilson-fp9svr
Iâd suggest you come back to my last reply and try to adjust the conditional statement to also check the connection target. Iâm sure you can figure this out and learn something in the process.