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

Optional alternate behaviour for revalidateOn #225

Open
Scott-MacD opened this issue Jul 13, 2024 · 3 comments
Open

Optional alternate behaviour for revalidateOn #225

Scott-MacD opened this issue Jul 13, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@Scott-MacD
Copy link

Would it be possible to get an additional useForm config option to allow somebody to change the behaviour of revalidateOn to keep using that method after a field has been made dirty?

I prefer showing users an error message as soon as it is clear that they have likely made a mistake, to give the user the chance to make the corrections as they progress through a form. In order to do this, I have validateOn set to 'change', and revalidateOn set to input, which works great - however as soon as the user types a value that satisfies validation, if they continue to type and cause a case that fails validation, they won't know that until they blur from the field again. It would be ideal if we could set an option so that once a field has failed validation once, it will keep using the revalidateOn method from that point onwards.

@fabian-hiller fabian-hiller self-assigned this Jul 14, 2024
@fabian-hiller fabian-hiller added the enhancement New feature or request label Jul 14, 2024
@fabian-hiller
Copy link
Owner

Thanks for the idea. I will think about it, but unfortunately I will not have time to work on Modular Forms in the next few months.

@Scott-MacD
Copy link
Author

Not a problem, I think I will take a shot at making that change for my project, happy to submit a PR if I get it figured out and you're aligned.

@fabian-hiller
Copy link
Owner

Yes, feel free to share your ideas. I plan to re rewrite the library as some point in the future.

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

2 participants