Skip to content

Commit 7bd5430

Browse files
committed
fix(admin): fixed a reset form bug on CompetenceBlocForm
1 parent cdc7bf1 commit 7bd5430

File tree

1 file changed

+9
-1
lines changed
  • packages/reva-admin-react/src/app/(admin)/certifications-v2/[certificationId]/bloc-competence/_components

1 file changed

+9
-1
lines changed

packages/reva-admin-react/src/app/(admin)/certifications-v2/[certificationId]/bloc-competence/_components/CompetenceBlocForm.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const CompetenceBlocForm = ({
4040
const {
4141
register,
4242
control,
43+
reset,
4344
handleSubmit,
4445
formState: { isDirty, isSubmitting, errors },
4546
} = methods;
@@ -66,7 +67,14 @@ export const CompetenceBlocForm = ({
6667
(e) => console.log(e),
6768
);
6869
return (
69-
<form onSubmit={handleFormSubmit} className={`flex flex-col ${className}`}>
70+
<form
71+
onSubmit={handleFormSubmit}
72+
className={`flex flex-col ${className}`}
73+
onReset={(e) => {
74+
e.preventDefault();
75+
reset();
76+
}}
77+
>
7078
<Input
7179
data-test="competence-bloc-label-input"
7280
label="Intitulé du bloc de compétences"

0 commit comments

Comments
 (0)