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
constasyncValidate=(values/*, dispatch */)=>{returnsleep(1000).then(()=>{returnnewPromise((resolve,reject)=>{if(['john','paul','george','ringo'].includes(values.username)){reject({username: 'That username is taken'})}else{resolve('You shall not pass!')}})})}
In case of success validation, promise is resolved with some data (in our case just string You shall not pass!).
Async validation works just fine, but submitting of the form is impossible.
Error in console after submit: (index):1 Uncaught (in promise) You shall not pass!
What is the expected behavior?
Async validation returns promise, if promise is resolved (no matter with or without data provided) – async validation should pass and form submission should work as usual.
What is the current behavior?
We have a form with async validation (same as in Async Blur Validation Example)
We have a following validation function:
In case of success validation, promise is resolved with some data (in our case just string
You shall not pass!
).Async validation works just fine, but submitting of the form is impossible.
Error in console after submit:
(index):1 Uncaught (in promise) You shall not pass!
What is the expected behavior?
Async validation returns promise, if promise is resolved (no matter with or without data provided) – async validation should pass and form submission should work as usual.
Sandbox Link
Live example: https://redux-form-broken-validation.herokuapp.com/
Live example source code: https://github.com/afitiskin/redux-form/tree/broken-async-validation-example/examples/brokenAsyncValidation
What's your environment?
Latest versions of packages and browsers
It is a duplicate of #2056 with formal bug report.
The text was updated successfully, but these errors were encountered: