From a88a1848ffee01163cf8354a8e9bb87680ed05eb Mon Sep 17 00:00:00 2001 From: balibabu Date: Thu, 5 Dec 2024 10:53:44 +0800 Subject: [PATCH] Fix: The right coordinates of Categorize and Switch operators are misplaced #3868 (#3869) ### What problem does this PR solve? Fix: The right coordinates of Categorize and Switch operators are misplaced #3868 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- web/src/components/editable-cell.tsx | 6 +----- web/src/pages/flow/canvas/node/hooks.ts | 4 ++-- web/src/pages/flow/canvas/node/relevant-node.tsx | 4 ++-- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/web/src/components/editable-cell.tsx b/web/src/components/editable-cell.tsx index ff5092ef3..85f5610b8 100644 --- a/web/src/components/editable-cell.tsx +++ b/web/src/components/editable-cell.tsx @@ -90,11 +90,7 @@ export const EditableCell: React.FC = ({ ) : ( -
+
{children}
); diff --git a/web/src/pages/flow/canvas/node/hooks.ts b/web/src/pages/flow/canvas/node/hooks.ts index a2bdf0586..ce11dc6fa 100644 --- a/web/src/pages/flow/canvas/node/hooks.ts +++ b/web/src/pages/flow/canvas/node/hooks.ts @@ -35,7 +35,7 @@ export const useBuildCategorizeHandlePositions = ({ list.push({ text: x, idx, - top: idx === 0 ? 98 : list[idx - 1].top + 8 + 26, + top: idx === 0 ? 98 + 20 : list[idx - 1].top + 8 + 26, }); }); @@ -71,7 +71,7 @@ export const useBuildSwitchHandlePositions = ({ }> = []; [...conditions, ''].forEach((x, idx) => { - let top = idx === 0 ? 58 : list[idx - 1].top + 32; // case number (Case 1) height + flex gap + let top = idx === 0 ? 58 + 20 : list[idx - 1].top + 32; // case number (Case 1) height + flex gap if (idx - 1 >= 0) { const previousItems = conditions[idx - 1]?.items ?? []; if (previousItems.length > 0) { diff --git a/web/src/pages/flow/canvas/node/relevant-node.tsx b/web/src/pages/flow/canvas/node/relevant-node.tsx index 5e2251759..c79551d9e 100644 --- a/web/src/pages/flow/canvas/node/relevant-node.tsx +++ b/web/src/pages/flow/canvas/node/relevant-node.tsx @@ -33,7 +33,7 @@ export function RelevantNode({ id, data, selected }: NodeProps) { isConnectable className={styles.handle} id={'yes'} - style={{ ...RightHandleStyle, top: 59 }} + style={{ ...RightHandleStyle, top: 57 + 20 }} > ) { isConnectable className={styles.handle} id={'no'} - style={{ ...RightHandleStyle, top: 112 }} + style={{ ...RightHandleStyle, top: 115 + 20 }} >