-
-
Notifications
You must be signed in to change notification settings - Fork 616
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() not working with promise #444
Comments
Thanks for the report @jplusje. The code currently expects all validators to unbox as a truthy value. This means even async validators that return promises should have a value, eg |
After changing my code to always resolve the promise but include a true/false it indeed works. I've also tested it with my actual implementation which returns a real promise and resolves it later and that also works. thanks! |
Yes, but as the docs say, a resolved promise should mean a passed validation, and this is not happening yet. Will fix it so this doesn't happen to other users in the future. |
This happened to me too. It needs to |
@dimpen that's not the intended behaviour. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I am trying to get .custom() working from the check API but it appears that it's not working?
Working (only showing essential information):
Not working (only showing essential information:
The docs state:
The custom validator may return a promise to indicate an async validation task. In case it's rejected, the field is considered invalid.
Therefore I would expect both examples to result in a "passed validation" however the second example always fails.
The text was updated successfully, but these errors were encountered: