Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix form submitting

dominik-zeglen88379288afb0
diff --git a/saleor/static/dashboard-next/components/Form/Form.tsx b/saleor/static/dashboard-next/components/Form/Form.tsx
index 2cd88abde4..25512cf573 100644
--- a/saleor/static/dashboard-next/components/Form/Form.tsx
+++ b/saleor/static/dashboard-next/components/Form/Form.tsx
@@ -17,7 +17,7 @@ function Form<T>(props: FormProps<T>) {
const renderProps = useForm(initial, errors, onSubmit);
function handleSubmit(event?: React.FormEvent<any>, cb?: () => void) {
- const { reset } = renderProps;
+ const { reset, submit } = renderProps;
if (event) {
event.stopPropagation();
@@ -31,6 +31,8 @@ function Form<T>(props: FormProps<T>) {
if (resetOnSubmit) {
reset();
}
+
+ submit();
}
return <form onSubmit={handleSubmit}>{children(renderProps)}</form>;