From 225298447dcb754d6248b480ef4fab6fc0aa1a8e Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Sun, 22 May 2022 12:13:31 +0200 Subject: [PATCH] Set z-index via CSS --- src/container/EdgeRenderer/index.tsx | 11 +---------- src/style.css | 4 ++++ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/container/EdgeRenderer/index.tsx b/src/container/EdgeRenderer/index.tsx index 42bf3ba0..2f4fdc37 100644 --- a/src/container/EdgeRenderer/index.tsx +++ b/src/container/EdgeRenderer/index.tsx @@ -73,18 +73,9 @@ const EdgeRenderer = (props: EdgeRendererProps) => { return null; } - const { connectionLineType, defaultMarkerColor, connectionLineStyle, connectionLineComponent } = props; + const { connectionLineType, defaultMarkerColor, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle } = props; const renderConnectionLine = connectionNodeId && connectionHandleType; - let { connectionLineContainerStyle } = props - if (connectionLineContainerStyle?.zIndex === undefined) { - // if not set already, set the zIndex to the max level of the any edge - connectionLineContainerStyle = { - ...connectionLineContainerStyle, - zIndex: edgeTree.find(({ isMaxLevel }) => isMaxLevel)?.level - } - } - return ( <> {edgeTree.map(({ level, edges, isMaxLevel }) => ( diff --git a/src/style.css b/src/style.css index 0a725c6f..88fab950 100644 --- a/src/style.css +++ b/src/style.css @@ -36,6 +36,10 @@ overflow: visible; } +.react-flow .react-flow__connectionline { + z-index: 1001; +} + .react-flow__edge { pointer-events: visibleStroke;