diff --git a/.changeset/silly-taxis-drop.md b/.changeset/silly-taxis-drop.md new file mode 100644 index 00000000..e26bd820 --- /dev/null +++ b/.changeset/silly-taxis-drop.md @@ -0,0 +1,5 @@ +--- +'@reactflow/core': patch +--- + +Core: Always elevate zIndex when node is selected diff --git a/packages/core/src/store/utils.ts b/packages/core/src/store/utils.ts index f9a79ea1..e54db262 100644 --- a/packages/core/src/store/utils.ts +++ b/packages/core/src/store/utils.ts @@ -39,7 +39,7 @@ export function createNodeInternals(nodes: Node[], nodeInternals: NodeInternals) const parentNodes: ParentNodes = {}; nodes.forEach((node) => { - const z = isNumeric(node.zIndex) ? node.zIndex : node.selected ? 1000 : 0; + const z = (isNumeric(node.zIndex) ? node.zIndex : 0) + (node.selected ? 1000 : 0); const currInternals = nodeInternals.get(node.id); const internals: Node = {