From 2e5e5285c571275fbe2f45366a345275ebab11a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20M=C3=B6ller?= Date: Mon, 21 Mar 2022 13:52:10 +0100 Subject: [PATCH] fix(zIndex): calculate zIndex for nested flows correctly --- src/store/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/store/utils.ts b/src/store/utils.ts index a41799f8..a4926169 100644 --- a/src/store/utils.ts +++ b/src/store/utils.ts @@ -33,7 +33,7 @@ function calculateXYZPosition( return calculateXYZPosition(parentNode, nodeInternals, parentNodes, { x: (result.x ?? 0) + (parentNode.position?.x ?? 0), y: (result.y ?? 0) + (parentNode.position?.y ?? 0), - z: (parentNode.z ?? 0) > (node.z ?? 0) ? parentNode.z ?? 0 : node.z ?? 0, + z: (parentNode.z ?? 0) > (result.z ?? 0) ? parentNode.z ?? 0 : result.z ?? 0, }); } @@ -43,6 +43,7 @@ export function createNodeInternals(nodes: Node[], nodeInternals: NodeInternals) nodes.forEach((node) => { const z = isNumeric(node.zIndex) ? node.zIndex : node.dragging || node.selected ? 1000 : 0; + const internals: Node = { ...nodeInternals.get(node.id), ...node,