You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
step 1: click submit button
step2: click add new button
The text was updated successfully, but these errors were encountered:
qingzhoufeihu
changed the title
After triggering form validation once, any subsequent forms added using the insert method will immediately trigger validation.
Validate: After triggering form validation once, any subsequent forms added using the insert method will immediately trigger validation.
Dec 3, 2024
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 revalidateOn option of useForm or createForm to 'submit'. What is your use case? Can't you enter a valid value when calling insert?
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.
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
The text was updated successfully, but these errors were encountered: