Skip to content

Commit

Permalink
Merge pull request #24 from concord-consortium/185596219-make-entire-…
Browse files Browse the repository at this point in the history
…node-draggable

fix: Dragging node on left side when it has a loop [PT-185596219]
  • Loading branch information
dougmartin authored Jul 13, 2023
2 parents 1fe3180 + c55a99c commit 9c709ad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,8 @@ export const Graph = (props: Props) => {
})
;

const loopStyle = drawingMode === "delete" ? "cursor: pointer" : "pointer-events: none";

const loopBackgrounds = svg
.selectAll("path.loop-background")
.data(d3Graph.nodes.filter(n => n.loops))
Expand All @@ -504,7 +506,7 @@ export const Graph = (props: Props) => {
.attr("stroke-opacity", 0)
.attr("fill-opacity", 0)
.attr("stroke-width", 15)
.attr("style", drawingMode === "delete" ? "cursor: pointer" : "")
.attr("style", loopStyle)
.on("click", (e, d) => {
onNodeClick?.(d.id, true);
})
Expand All @@ -522,7 +524,7 @@ export const Graph = (props: Props) => {
.attr("fill-opacity", 0)
.attr("stroke-width", d => d.loopWeight)
.attr("marker-end", "url(#arrow)")
.attr("style", drawingMode === "delete" ? "cursor: pointer" : "")
.attr("style", loopStyle)
.on("click", (e, d) => {
onNodeClick?.(d.id, true);
})
Expand Down

0 comments on commit 9c709ad

Please sign in to comment.