Allow native fields to be marked as "touched" on change, the same as is allowed for createField
#308
Labels
enhancement
New feature or request
createField
#308
Is your feature request related to a problem? Please describe.
Our UX standards are specified that a user tabbing through fields should not immediately see error messages for those fields if they have not actually changed any values. However, the default behavior of Felte is to always validate on blur.
From the documentation, we can see that fields registered via
createField
can use thetouchOnChange
option to alter this behavior, but that does not seem to be an option for native fields that are registered automatically via thename
attribute.Describe the solution you'd like
It would be great if we could create a similar
touchOnChange
option forcreateForm
which will bring that functionality to Felte globally. This would similarly mark fields as touched on change, and not mark fields as touched on blur.Describe alternatives you've considered
We've attempted to use
isDirty
to avoid showing errors on a clean form, but once any field value is changed, all the others that were tabbed through immediately display errors. We're open to any other suggestions, but looking through the docs and issues on GitHub, we're pretty much stumped.Additional context
We already check for updated data to set fields as touched as the data itself changes, so we can at least meet our UX standard that errors should be displayed on change, but without the ability to prevent fields being marked as touched on blur, we still display errors too soon.
The text was updated successfully, but these errors were encountered: