-
Notifications
You must be signed in to change notification settings - Fork 7
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 users to skip validation or to fallback to server validation #50
Conversation
result[name] = | ||
result[name] === null || | ||
e.message === conformValibotMessage.VALIDATION_SKIPPED | ||
? null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If error[name]
is null, Conform reuses previous error value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
result === null || | ||
e.message === conformValibotMessage.VALIDATION_UNDEFINED | ||
) { | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If error field is null, Conform stop reporting errors and proceed with browser's built-in form submission process (don't call event.preventDefault()
for submit
event).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the great PR.
Looks good. Let's merge!
result === null || | ||
e.message === conformValibotMessage.VALIDATION_UNDEFINED | ||
) { | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
result[name] = | ||
result[name] === null || | ||
e.message === conformValibotMessage.VALIDATION_SKIPPED | ||
? null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 This PR is included in version 1.13.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@conform-to/zod
allows user to skip validation or to fallback to server validation: conform/docs/api/zod/conformZodMessage.md at main · edmundhung/conform.It is very helpful if conform-to-valibot also supports these features.