Merge pull request #5511 from xyflow/fix-edge-elevation-2
Fix edge elevation when connected nodes are selected
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
'@xyflow/system': patch
|
||||||
|
'@xyflow/react': patch
|
||||||
|
'@xyflow/svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix regression: elevate edges if connected nodes are selected
|
||||||
@@ -45,12 +45,11 @@ export function getElevatedEdgeZIndex({
|
|||||||
if (zIndex !== undefined) {
|
if (zIndex !== undefined) {
|
||||||
return zIndex;
|
return zIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
const edgeZ = elevateOnSelect && selected ? 1000 : 0;
|
const edgeZ = elevateOnSelect && selected ? 1000 : 0;
|
||||||
|
|
||||||
const nodeZ = Math.max(
|
const nodeZ = Math.max(
|
||||||
sourceNode.parentId ? sourceNode.internals.z : 0,
|
sourceNode.parentId || (elevateOnSelect && sourceNode.selected) ? sourceNode.internals.z : 0,
|
||||||
targetNode.parentId ? targetNode.internals.z : 0
|
targetNode.parentId || (elevateOnSelect && targetNode.selected) ? targetNode.internals.z : 0
|
||||||
);
|
);
|
||||||
|
|
||||||
return edgeZ + nodeZ;
|
return edgeZ + nodeZ;
|
||||||
|
|||||||
Reference in New Issue
Block a user