Skip to content

Commit

Permalink
Topology: do not drag on MB2, MB3, or control clicks.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-phillips-18 committed Nov 22, 2019
1 parent 4200273 commit 5eacf0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion frontend/packages/topology/src/behavior/useDndDrag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@ export const useDndDrag = <
}
}),
)
.filter(() => dndManager.canDragSource(idRef.current)),
.filter(
() =>
!d3.event.ctrlKey && !d3.event.button && dndManager.canDragSource(idRef.current),
),
);
}
return () => {
Expand Down
3 changes: 2 additions & 1 deletion frontend/packages/topology/src/behavior/usePanZoom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ export const usePanZoom = (zoomExtent: [number, number] = ZOOM_EXTENT): PanZoomR
);
elementRef.current.setScale(d3.event.transform.k);
}),
);
)
.filter(d3.drag().filter());
zoom($svg);

// Update the d3 transform whenever the scale or bounds change.
Expand Down

0 comments on commit 5eacf0a

Please sign in to comment.