diff --git a/packages/core/src/components/FormInput/FormInput.tsx b/packages/core/src/components/FormInput/FormInput.tsx index c6a7bc4..969a8a2 100644 --- a/packages/core/src/components/FormInput/FormInput.tsx +++ b/packages/core/src/components/FormInput/FormInput.tsx @@ -129,14 +129,16 @@ const FormInput = ({ error: formInputError.hasErrors, }; + const inputValue = value ?? defaultValue ?? formInputMeta.initialValue; + const isUntouched = ( - (value || defaultValue || formInputMeta.initialValue) + !!inputValue && !formInputMeta.touched && !isInitializedRef.current ); if (isUntouched) { - form.setFieldValue(name, value || defaultValue || formInputMeta.initialValue); + form.setFieldValue(name, inputValue); inputProps.defaultValue = undefined; isInitializedRef.current = true;