We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If onSubmit returns a promise, it runs silently in the background during handleSubmit in some cases.
onSubmit
handleSubmit
This happens when createForm is called without validationSchema and onSubmit is an asynchronous function.
createForm
validationSchema
The behavior stems from a missing return here.
return
Use createForm with an asynchronous onSubmit function and no validation.
In the example project below, the https://codesandbox.io/s/gifted-bush-vdhii?file=/App.svelte
handleSubmit does not return the promise from onSubmit.
handleSubmit should return the promise from onSubmit.
Add a return statement here.
The text was updated successfully, but these errors were encountered:
A temporary work-around is to include a validationSchema which correctly returns the onSubmit promise.
Sorry, something went wrong.
🎉 This issue has been resolved in version 2.0.1 🎉
The release is available on:
Your semantic-release bot 📦🚀
Successfully merging a pull request may close this issue.
Summary
If
onSubmit
returns a promise, it runs silently in the background duringhandleSubmit
in some cases.This happens when
createForm
is called withoutvalidationSchema
andonSubmit
is an asynchronous function.The behavior stems from a missing
return
here.Steps to reproduce
Use
createForm
with an asynchronousonSubmit
function and no validation.Example Project
In the example project below, the
https://codesandbox.io/s/gifted-bush-vdhii?file=/App.svelte
What is the current bug behavior?
handleSubmit
does not return the promise fromonSubmit
.What is the expected correct behavior?
handleSubmit
should return the promise fromonSubmit
.Relevant logs and/or screenshots
Possible fixes
Add a
return
statement here.The text was updated successfully, but these errors were encountered: