luciodale / fork

A non-intrusive Clojurescript form management library for Re-frame and Reagent.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fork should set all fields to touched on submission

conjurernix opened this issue · comments

From my understanding, the correct behavior is to set to touched on submission so you can then display and error/validation messages. Formik does the same https://formik.org/docs/guides/form-submission

It should work if you correctly plug handle-submit: the touched function checks for attempted submission so there is no need to set the touched value for the fields (besides, we don't know the full list of fields, it's probably why Formik requires the initial values)

Yeah, the point was to not enforce any initial values.. if you're using touched exposed by the API you shouldn't have any problems, but if you're reaching for the touched key directly in your state you have to replicate what I'm doing here.