From 3c6d9fb3882409b2954be692a829f9ab81de01cc Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Sat, 30 Mar 2024 01:55:51 +0200 Subject: [PATCH] Fixed dropdown placeholder --- .../GenericNode/components/parameterComponent/index.tsx | 2 +- src/frontend/src/components/dropdownComponent/index.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index 141ed59cd..7f7378bb3 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -605,7 +605,7 @@ export default function ParameterComponent({ isLoading={isLoading} options={data.node.template[name].options} onSelect={handleOnNewValue} - value={data.node.template[name].value ?? "Choose an option"} + value={data.node.template[name].value} id={"dropdown-" + name} /> diff --git a/src/frontend/src/components/dropdownComponent/index.tsx b/src/frontend/src/components/dropdownComponent/index.tsx index 983ee4cf0..729b11a55 100644 --- a/src/frontend/src/components/dropdownComponent/index.tsx +++ b/src/frontend/src/components/dropdownComponent/index.tsx @@ -52,7 +52,9 @@ export default function Dropdown({ editNode ? "input-edit-node" : "py-2" )} > - {value + {(value && + value !== "" && + options.find((option) => option === value)) ? options.find((option) => option === value) : "Choose an option..."}