From 5c0d19e36d9f3b7ac6da89328942e7da10861143 Mon Sep 17 00:00:00 2001 From: twwu Date: Wed, 16 Jul 2025 10:33:59 +0800 Subject: [PATCH] fix: improve handleVariableNameBlur logic to prevent setting label when it already exists --- .../rag-pipeline/components/input-field/editor/form/hooks.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/app/components/rag-pipeline/components/input-field/editor/form/hooks.ts b/web/app/components/rag-pipeline/components/input-field/editor/form/hooks.ts index 986a69c188..bbca128cf1 100644 --- a/web/app/components/rag-pipeline/components/input-field/editor/form/hooks.ts +++ b/web/app/components/rag-pipeline/components/input-field/editor/form/hooks.ts @@ -92,10 +92,11 @@ export const useConfigurations = (props: { }, [setFieldValue]) const handleVariableNameBlur = useCallback((value: string) => { - if (!value) + const label = getFieldValue('label') + if (!value || label) return setFieldValue('label', value) - }, [setFieldValue]) + }, [getFieldValue, setFieldValue]) const handleDisplayNameBlur = useCallback((value: string) => { if (!value)