diff --git a/frontend/src/Editor/Components/DropDown.jsx b/frontend/src/Editor/Components/DropDown.jsx index 4a821e4e2e..0e28b9755f 100644 --- a/frontend/src/Editor/Components/DropDown.jsx +++ b/frontend/src/Editor/Components/DropDown.jsx @@ -63,6 +63,19 @@ export const DropDown = function DropDown({ const value = currentValueProperty ? currentValueProperty.value : ''; const [currentValue, setCurrentValue] = useState(''); + const [optionValues, setOptionValue] = useState(() => selectOptions); + + useEffect(() => { + const nextOptionValues = JSON.stringify(parsedValues); + const prevOptionValues = JSON.stringify(optionValues); + + if (nextOptionValues !== prevOptionValues) { + setOptionValue(() => JSON.parse(nextOptionValues)); + setCurrentValue(''); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [parsedValues]); + let newValue = value; if (currentValueProperty && currentState) { newValue = resolveReferences(currentValueProperty.value, currentState, '');