fix(canvas): restore visible handle glow during drag

This commit is contained in:
2026-04-11 09:20:39 +02:00
parent e33e032cfc
commit 079bc34ce4
4 changed files with 100 additions and 12 deletions

View File

@@ -7,6 +7,7 @@ import {
getSmoothStepPath,
getStraightPath,
type ConnectionLineComponentProps,
useConnection,
useReactFlow,
} from "@xyflow/react";
import { useEffect, useMemo } from "react";
@@ -52,14 +53,20 @@ export default function CustomConnectionLine({
connectionStatus,
}: ConnectionLineComponentProps) {
const { getNodes, getEdges } = useReactFlow();
const connection = useConnection();
const { activeTarget, setActiveTarget } = useCanvasConnectionMagnetism();
const fromHandleId = fromHandle?.id;
const fromNodeId = fromNode?.id;
const connectionFromHandleType =
connection.fromHandle?.type === "source" || connection.fromHandle?.type === "target"
? connection.fromHandle.type
: null;
const fromHandleType =
fromHandle?.type === "source" || fromHandle?.type === "target"
? fromHandle.type
: null;
: connectionFromHandleType ?? "source";
const resolvedMagnetTarget = useMemo(() => {
if (!fromHandleType || !fromNodeId) {