#Is there a way to get Mantine form to validate onBlur and re-validate onChange?
9 messages · Page 1 of 1 (latest)
I don't want it to validate onChange right away. I want it to first validate on blur, and then "re-validate" onChange. This way the user is not presented with an error right away. But after blur, validations switch to onChange.
It's a very helpful feature.
Am I describing it well enough to understand?
you can extend form.getInputProps to handle this
i've misread what you want and just done an example onBlur - either way you can extend this function so that after first blur it sets a state, then validate during onChange
Yes, I see it now. Thank you.
As for tracking a previous onBlur, would I need to manage my own state for that, or does the form track this?
perhaps isTouched or isDirty could help, but i never personally use them so i could not answer
https://mantine.dev/form/use-form/#touched-and-dirty
if they do not help then just track your own separate state