fix: improve handleVariableNameBlur logic to prevent setting label when it already exists

This commit is contained in:
twwu 2025-07-16 10:33:59 +08:00
parent e0753ebfd1
commit 5c0d19e36d
1 changed files with 3 additions and 2 deletions

View File

@ -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)