Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
phobetron opened this issue Nov 8, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@phobetron
Copy link

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.

@phobetron phobetron added the enhancement New feature or request label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant