diff --git a/openbas-front/src/admin/components/settings/policies/PolicyForm.tsx b/openbas-front/src/admin/components/settings/policies/PolicyForm.tsx index 48362deb6c..2cb745a9dd 100644 --- a/openbas-front/src/admin/components/settings/policies/PolicyForm.tsx +++ b/openbas-front/src/admin/components/settings/policies/PolicyForm.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useEffect } from 'react'; import { useForm, FormProvider, SubmitHandler } from 'react-hook-form'; import { Button } from '@mui/material'; import MarkDownField from '../../../../components/fields/MarkDownField'; @@ -28,8 +28,13 @@ const PolicyForm: React.FC = ({ const { handleSubmit, formState: { isDirty, isSubmitting }, + reset, } = methods; + useEffect(() => { + reset(initialValues); + }, [initialValues, reset]); + return (