mobx-react-hook-form 5.1.2 → 5.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/mobx-form/mobx-form.js +4 -4
- package/package.json +1 -1
package/mobx-form/mobx-form.js
CHANGED
|
@@ -388,11 +388,11 @@ export class Form {
|
|
|
388
388
|
*/
|
|
389
389
|
submit(e) {
|
|
390
390
|
return new Promise((resolve, reject) => {
|
|
391
|
-
this.originalForm.handleSubmit((data, event) => {
|
|
392
|
-
this.config.onSubmit?.(data, event);
|
|
391
|
+
this.originalForm.handleSubmit(async (data, event) => {
|
|
392
|
+
await this.config.onSubmit?.(data, event);
|
|
393
393
|
resolve(data);
|
|
394
|
-
}, (errors, event) => {
|
|
395
|
-
this.config.onSubmitFailed?.(errors, event);
|
|
394
|
+
}, async (errors, event) => {
|
|
395
|
+
await this.config.onSubmitFailed?.(errors, event);
|
|
396
396
|
reject(errors);
|
|
397
397
|
})(e);
|
|
398
398
|
});
|