Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dragging new edge to child node also creates edge to parent node (sometimes) #2

Closed
aschriner opened this issue Mar 17, 2014 · 5 comments

Comments

@aschriner
Copy link

Consider three nodes: node A, child Node, and parent Node.
If I drag from nodeA to child node and release (to create an edge from node A to child node), sometimes an edge is also created from node A to parent node. Whether or not the edge from node A to parent node is created seems to depend on exactly where the mouseup happens on child node.

Separately, but possibly related to the location issue - there is some small misalignment between mouseup and the targetnode. Sometimes when mouseup is off to the side of the node, the edge is still created to the node. In my particular case this happens off to the left side only, not top or bottom or right.

But this doesn't explain why two edges are created.

I have the cy div set with position: absolute, which might be related to the location issue. I thought that was fixed in this version of the plugin (after separating from the cytoscapejs core)...?

@maxkfranz
Copy link
Member

I don't think this plugin supports compound nodes (yet).

@aschriner
Copy link
Author

Is this an issue of event bubbling? i might be able to help add support for this feature bc it is important for my application.

@aschriner
Copy link
Author

I don't think this is related to event bubbling - I think it has to do with line 276 of the .js file
var targets = tgt ? tgt : cy.nodes(".edgehandles-target");

both the parent and child node are getting the "edgehandles-target" class.

What is the reason behind selecting multiple targets (I'm assuming because of the plural that this is intended behavior)

@maxkfranz
Copy link
Member

You can select multiple targets in one pass. I'm guessing both the parent and child are getting mouseover/tapover so they're both targets.

Since children are within parents, the parent is always going to be selected. Maybe a flag to disable parents or increasing the time delay would help?

@maxkfranz
Copy link
Member

This should be OK if you set toggleOffOnLeave: true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants