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 to move nodes, create edges unreliable on mouse #363

Open
bergie opened this issue Aug 10, 2017 · 2 comments
Open

Dragging to move nodes, create edges unreliable on mouse #363

bergie opened this issue Aug 10, 2017 · 2 comments
Labels

Comments

@bergie
Copy link
Member

bergie commented Aug 10, 2017

When dragging a node/port with mouse (Chrome OS 60), you sometimes get a canvas pan, sometimes the desired action. With touch it works reliably.

It seems a Hammer.js issue (hammerjs/hammer.js#1113, though that one reporting it wrong way around), but we need to try to find a workaround.

Looking at the events happening, the difference appears to be that with mouse, we are getting first event (mousedown) with correct target, but then the second event (mousemove) is already above a different target, causing the gesture to be detected to the new target, not the original one.

Dragging with mouse:

screenshot 2017-08-10 at 13 17 52

Dragging with touch:

screenshot 2017-08-10 at 13 18 10

Events logged with

hammertime.on("hammer.input", function(ev) {                    
   console.log(ev.pointers[0].type, ev.pointers[0].target, ev.pointers[0].currentTarget);
});

I wonder if we can tweak pan recognizer settings to fix this? http://hammerjs.github.io/recognizer-pan/

@bergie
Copy link
Member Author

bergie commented Aug 10, 2017

We've got this trick in graph nodes to make their bounding boxes larger when moved:

https://github.com/flowhub/the-graph/blob/master/the-graph/the-graph-node.js#L486

One fix might be to do this already on pointerdown instead of waiting for drag recognizer.

@KMontag42
Copy link

I have found that clicking on the node produces the desired action (creating a new edge) consistently as well. Dragging in Chrome Version 62.0.3202.62 (Official Build) (64-bit) on Linux rarely works.

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

No branches or pull requests

2 participants