Validate: After triggering form validation once, any subsequent forms added using the insert method will immediately trigger validation.
In the "todos" example in the playground, after clicking the submit button to trigger validation, if you click the add button, the newly added item automatically triggers validation. How can we avoid this validation?
https://modularforms.dev/react/playground/todos
step 1: click submit button step2: click add new button
Currently you can only avoid it by changing the revalidateOn option of useForm or createForm to 'submit'. What is your use case? Can't you enter a valid value when calling insert?
Currently you can only avoid it by changing the
revalidateOnoption ofuseFormorcreateFormto'submit'. What is your use case? Can't you enter a valid value when callinginsert?
Thanks for your reply, "blur" works for me.I mean, if I set revalidateOn: "change" and then I click the "add new" button without entering anything in the newly appeared field, why does the new field directly trigger validation and show an error message?
This should only happen after the form has already been submitted, but I can see where you are coming from and why the current behavior can be annoying. Perhaps we should offer an option to control this when calling insert.