final-form / final-form

🏁 Framework agnostic, high performance, subscription-based form state management

Home Page:https://final-form.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Field level initialValues don't validate before form is touched

shifraHolzer opened this issue · comments

Are you submitting a bug report or a feature request?

Kudos for a great framework! I'm not sure if this is a bug or expected behavior, but Id like to think this is a bug and thus a feature request.

What is the current behavior?

Field level initialValue values aren't validated until form is touched.

Code Sandbox:
https://codesandbox.io/s/react-final-form-simple-example-lvk4m

What is the expected behavior?

I would have thought that initialValue on the field level would behave the same as the form level initialValues, where the validation happens initially.

For me, this is an issue where I have a form that should pass validation even if the user didn't edit any fields (as the required fields are prepopulated with initialValue values on the field level), but is failing validation because the validation only ran against the form level initialValues.

Fix published in v4.18.7.