jsplumb / community-edition

The community edition of jsPlumb, versions 1.x - 6.x
https://jsplumbtoolkit.com
Other
237 stars 22 forks source link

Group collapse bug when using scoped connections #36

Open waltersf opened 6 years ago

waltersf commented 6 years ago

Hi,

I'm using jsplumb version 2.5.7 and scoped connections. I decided to include the group feature to my workflow, but when I collapse the group, the connections are lost if they were previously created. I searched for related issues, but they were related to older versions. Looking the code, I found the function _updateConnectionsForGroup(group) in the file group.js, where members' connections are retrieved using the following code:

var c1 = _jsPlumb.getConnections({source:members}, true);
var c2 = _jsPlumb.getConnections({target:members}, true);

I changed the source code directly to:

var c1 = _jsPlumb.getConnections({source:members, scope: '*'}, true);
var c2 = _jsPlumb.getConnections({target:members, scope: '*'}, true);

And now it is working. Is it really a bug or am I doing something wrong?

Best

sporritt commented 6 years ago

I think it might be a bug in fact. The intent of those lines you quoted is definitely to do what you managed to get to happen with your revised code. I'll look into this, thanks.