remix-validated-form
remix-validated-form copied to clipboard
[Feature]: Maintaining a mirrored form state for producing an `isValid` without displaying error messages.
What is the new or updated feature that you are suggesting?
In regards to https://github.com/airjp73/remix-validated-form/issues/158, my implemented solution was to produce a 1:1 of the form with the form id of ${formId}_VALIDATOR
. On all my inputs I have a useControlField
/useUpdateControlledField
to update the validator form when values change. I use the isValid
of the Validator Form to enable/disable a Submit button when values are appropriate for the schema. Mostly this works without a hitch, but occasionally on more complex inputs it gets some weirdness. I believe it would be much easier and less complex if this optional ability was native to remix-validated-form
. I don't know if this would be as simple as one-way syncing the form state to a duplicate. I'd be happy to work on a PR based upon any guidance.
Why should this feature be included?
This would enable a lot of different workflows succinctly and provide a great user-experience. Enabling submit buttons when schema is achieved ( my use-case ); displaying new form fields with valid schemas; Auto-submissions based on valid schemas.