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

Custom Validation Only Works If Field is Filled #1

Closed
jdlien opened this issue May 16, 2023 · 1 comment
Closed

Custom Validation Only Works If Field is Filled #1

jdlien opened this issue May 16, 2023 · 1 comment

Comments

@jdlien
Copy link
Owner

jdlien commented May 16, 2023

Attempting to use a custom validation to allow one field or another (but not both) is quite difficult right now because the custom validation only executes if the field has a value.

I propose changing this behaviour to always execute custom validation, even if the field is not filled.

This would be a breaking change if anyone is currently depending on the behaviour as is now. An alternative is to add a different kind of validator that will run all the time, even on empty fields so there is a way to have both behaviour.

I think having the custom validator always run, even when a field is not filled in is the most powerful approach as this way the user can simply return true from their custom validator if the value is empty.

@jdlien
Copy link
Owner Author

jdlien commented Jul 30, 2023

This behavior is now the default.

@jdlien jdlien closed this as completed Jul 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant