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

If the user clicks the node and drags it would be nice to not trigger the drag behaviour if the mousedown target is a node #1498

Closed
grdw opened this issue Oct 14, 2016 · 1 comment
Assignees

Comments

@grdw
Copy link
Contributor

grdw commented Oct 14, 2016

it would be nice to not trigger the drag behaviour if the mousedown target is a node/popup

It doesn't do this when it's a popup 👍 . It does do it when it's a node 👎 . I'm able to capture the event target when I'm zooming like this:

if (d3.event.sourceEvent.originalTarget.nodeName === "svg") {
   ...
}

This means that I only apply the transition of the svg when my initial mousedown was on the svg. However when I hold my mousedown on the circle and even barely move out of the circle my zoomListener does go into effect resulting in a really stuttery zoom (because I'm moving in and out of the circle).

Another approach would be to remove all zoom listeners from a certain d3 element like this:

d3.select("circle").on(".zoom", null);

However, the zoomListener is attached to the svg and therefor to all the elements inside the svg. So I'm a bit fiddling still but thought I might give you a status update 😄

@grdw grdw self-assigned this Oct 14, 2016
@grdw grdw added this to the Topology editor milestone Oct 14, 2016
@grdw
Copy link
Contributor Author

grdw commented Oct 14, 2016

Ow wait, the answer is already here. 😄

@grdw grdw closed this as completed Oct 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant