From 89a74345652a01f7702be48846c6940081935524 Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 24 Apr 2024 15:53:07 +0800 Subject: [PATCH] fix: handle inputs show the focus ui together in tools node (#3763) --- .../nodes/tool/components/input-var-list.tsx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/web/app/components/workflow/nodes/tool/components/input-var-list.tsx b/web/app/components/workflow/nodes/tool/components/input-var-list.tsx index dae8e2c61..c25fde498 100644 --- a/web/app/components/workflow/nodes/tool/components/input-var-list.tsx +++ b/web/app/components/workflow/nodes/tool/components/input-var-list.tsx @@ -100,8 +100,17 @@ const InputVarList: FC = ({ } }, [value, onChange]) - const [isFocus, setIsFocus] = useState(false) - + const [inputsIsFocus, setInputsIsFocus] = useState>({}) + const handleInputFocus = useCallback((variable: string) => { + return (value: boolean) => { + setInputsIsFocus((prev) => { + return { + ...prev, + [variable]: value, + } + }) + } + }, []) const handleOpen = useCallback((index: number) => { return () => onOpen(index) }, [onOpen]) @@ -126,13 +135,13 @@ const InputVarList: FC = ({ {isString ? ()