fix loop var change cause collaboration crash

This commit is contained in:
hjlarry 2025-10-13 10:06:50 +08:00
parent a300c9ef96
commit ecaff5b63f
1 changed files with 4 additions and 1 deletions

View File

@ -41,6 +41,9 @@ const FormItem = ({
}: FormItemProps) => {
const { t } = useTranslation()
const { value_type, var_type, value } = item
const normalizedVarValue = useMemo(() => {
return Array.isArray(value) ? value : []
}, [value])
const handleInputChange = useCallback((e: any) => {
onChange(e.target.value)
@ -79,7 +82,7 @@ const FormItem = ({
readonly={false}
nodeId={nodeId}
isShowNodeName
value={value}
value={normalizedVarValue}
onChange={handleChange}
filterVar={filterVar}
placeholder={t('workflow.nodes.assigner.setParameter') as string}