From 81a4c0698c4f2ccc13efd1f4542a1a9b3c76b55c Mon Sep 17 00:00:00 2001 From: balibabu Date: Mon, 23 Jun 2025 14:36:01 +0800 Subject: [PATCH] Feat: Solved the conflict between the Handle click and drag events of the canvas node #3221 (#8413) ### What problem does this PR solve? Feat: Solved the conflict between the Handle click and drag events of the canvas node #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality) --- .../node/dropdown/next-step-dropdown.tsx | 18 +++++++--- web/src/pages/agent/canvas/node/handle.tsx | 35 +++++++++++-------- .../pages/agent/canvas/node/message-node.tsx | 6 ++-- 3 files changed, 38 insertions(+), 21 deletions(-) diff --git a/web/src/pages/agent/canvas/node/dropdown/next-step-dropdown.tsx b/web/src/pages/agent/canvas/node/dropdown/next-step-dropdown.tsx index f8ffc4cb3..99f33471a 100644 --- a/web/src/pages/agent/canvas/node/dropdown/next-step-dropdown.tsx +++ b/web/src/pages/agent/canvas/node/dropdown/next-step-dropdown.tsx @@ -11,16 +11,20 @@ import { DropdownMenuLabel, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; +import { IModalProps } from '@/interfaces/common'; import { Operator } from '@/pages/agent/constant'; import { AgentInstanceContext, HandleContext } from '@/pages/agent/context'; import OperatorIcon from '@/pages/agent/operator-icon'; -import { PropsWithChildren, useContext } from 'react'; +import { PropsWithChildren, createContext, useContext } from 'react'; type OperatorItemProps = { operators: Operator[] }; +const HideModalContext = createContext['showModal']>(() => {}); + function OperatorItemList({ operators }: OperatorItemProps) { const { addCanvasNode } = useContext(AgentInstanceContext); const { nodeId, id, type, position } = useContext(HandleContext); + const hideModal = useContext(HideModalContext); return (