Skip to content

Commit 2c12f49

Browse files
committed
fix(subflows): make edges inside subflows directly clickable
Edges inside subflows defaulted to z-index 0, causing the subflow body area (pointer-events: auto) to intercept clicks. Derive edge z-index from the container's depth so edges sit just above their parent container but below canvas blocks and child blocks.
1 parent d0baf5b commit 2c12f49

File tree

1 file changed

+9
-1
lines changed
  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]

1 file changed

+9
-1
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3807,9 +3807,17 @@ const WorkflowContent = React.memo(
38073807
(targetNode?.zIndex ?? 21) + 1
38083808
)
38093809

3810+
// Edges inside subflows need a z-index above the container's body area
3811+
// (which has pointer-events: auto) so they're directly clickable.
3812+
// Derive from the container's depth-based zIndex (+1) so the edge sits
3813+
// just above its parent container but below canvas blocks (z-21+) and
3814+
// child blocks (z-1000).
3815+
const containerNode = parentLoopId ? nodeMap.get(parentLoopId) : null
3816+
const baseZIndex = containerNode ? (containerNode.zIndex ?? 0) + 1 : 0
3817+
38103818
return {
38113819
...edge,
3812-
zIndex: connectedToElevated ? elevatedZIndex : 0,
3820+
zIndex: connectedToElevated ? elevatedZIndex : baseZIndex,
38133821
data: {
38143822
...edge.data,
38153823
isSelected: selectedEdges.has(edgeContextId),

0 commit comments

Comments
 (0)