Skip to content

Allow native fields to be marked as "touched" on change, the same as is allowed for createField #308

Description

@phobetron

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 the touchOnChange option to alter this behavior, but that does not seem to be an option for native fields that are registered automatically via the name attribute.

Describe the solution you'd like
It would be great if we could create a similar touchOnChange option for createForm 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions