diff --git a/frontend/src/Editor/Components/DropDown.jsx b/frontend/src/Editor/Components/DropDown.jsx index ece706326b..2859e8275d 100644 --- a/frontend/src/Editor/Components/DropDown.jsx +++ b/frontend/src/Editor/Components/DropDown.jsx @@ -27,14 +27,18 @@ export const DropDown = function DropDown({ height, validate, properties, styles }, [isValid]); useEffect(() => { - setCurrentValue(value); - setExposedVariable('value', value); + let newValue = undefined; + if (values?.includes(value)) newValue = value; + + setCurrentValue(newValue); + setExposedVariable('value', newValue); // eslint-disable-next-line react-hooks/exhaustive-deps }, [value]); useEffect(() => { let newValue = undefined; - if (values?.includes(value)) newValue = value; + if (values?.includes(currentValue)) newValue = currentValue; + else if (values?.includes(value)) newValue = value; setCurrentValue(newValue); setExposedVariable('value', newValue);