diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/add-field.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/add-field.tsx index ab28233841..eba94e85dd 100644 --- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/add-field.tsx +++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/add-field.tsx @@ -12,7 +12,10 @@ const AddField = () => { const handleAddField = useCallback(() => { setIsAddingNewField(true) - emit('addField', { path: [] }) + // fix: when user change the last property type, the 'hoveringProperty' value will be reset by 'setHoveringPropertyDebounced(null)', that cause the EditCard not showing + setTimeout(() => { + emit('addField', { path: [] }) + }, 100) }, [setIsAddingNewField, emit]) return ( diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/index.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/index.tsx index 4aa0f99d3f..2733fcc11f 100644 --- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/index.tsx +++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/index.tsx @@ -122,7 +122,8 @@ const EditCard: FC = ({ }, [emit, path, parentPath, fields, currentFields]) const handlePropertyNameChange = useCallback((e: React.ChangeEvent) => { - setCurrentFields(prev => ({ ...prev, name: e.target.value })) + // fix: when user add name contains space, the variable reference will not work + setCurrentFields(prev => ({ ...prev, name: e.target.value?.trim() })) }, []) const handlePropertyNameBlur = useCallback(() => {