diff --git a/src/components/form/form/form.tsx b/src/components/form/form/form.tsx index 9e75e112..d7a3ebe8 100644 --- a/src/components/form/form/form.tsx +++ b/src/components/form/form/form.tsx @@ -123,11 +123,11 @@ export const Form: React.FC = ({ const [errorsState, setErrorsState] = useState(errors || {}); useEffect(() => { - return values && setValuesState(values); + values && setValuesState(values); }, [values]); useEffect(() => { - return errors && setErrorsState(errors); + errors && setErrorsState(errors); }, [errors]); const intl = useIntl(); diff --git a/src/components/form/select/select.tsx b/src/components/form/select/select.tsx index affb2823..6a8d64aa 100644 --- a/src/components/form/select/select.tsx +++ b/src/components/form/select/select.tsx @@ -130,8 +130,10 @@ export const Select: React.FC = ({ ); if (index === -1) { + setSelectedIndex(null); return; } + setSelectedIndex(index); }, [value, options]);