Skip to content

Commit

Permalink
fix: drag on toolbar handle into a scope (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
lihebi committed May 3, 2023
1 parent dd5d1a4 commit 04db0a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
6 changes: 3 additions & 3 deletions ui/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@
text-decoration: wavy underline red;
}

.react-flow__node-scope.active {
.react-flow__node-SCOPE.active {
box-shadow: 0px 0px 12px 0px rgba(100, 100, 100, 0.9);
}

.react-flow__node-scope.selected {
.react-flow__node-SCOPE.selected {
box-shadow: 0px 0px 8px 0px rgba(100, 100, 100, 0.5);
}

.react-flow__node-scope.selected {
.react-flow__node-SCOPE.selected {
border-width: 2px;
}

Expand Down
11 changes: 0 additions & 11 deletions ui/src/components/Canvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -588,17 +588,6 @@ function CanvasImpl() {
onNodeDragStop={(event, node) => {
removeDragHighlight();
let mousePos = project({ x: event.clientX, y: event.clientY });
// check if the mouse is still inside this node. If not, the user
// has beenn trying to move a pod out.
if (
mousePos.x < node.positionAbsolute!.x ||
mousePos.y < node.positionAbsolute!.y ||
mousePos.x > node.positionAbsolute!.x + node.width! ||
mousePos.y > node.positionAbsolute!.y + node.height!
) {
console.log("Cannot drop outside parent scope");
return;
}
let scope = getScopeAtPos(mousePos, node.id);
if (scope && scope.id !== node.parentNode) {
moveIntoScope(node.id, scope.id);
Expand Down

0 comments on commit 04db0a1

Please sign in to comment.