fix filters form
Some checks are pending
build / test (macOS-latest) (push) Waiting to run
build / test (ubuntu-latest) (push) Waiting to run
build / test (windows-latest) (push) Waiting to run
build / build-release (push) Blocked by required conditions
build / notify (push) Blocked by required conditions
lint / go-lint (push) Waiting to run
lint / eslint (push) Waiting to run
lint / notify (push) Blocked by required conditions

This commit is contained in:
Ildar Kamalov 2025-01-27 10:51:49 +03:00
parent 5279124130
commit 09b15210ed

View File

@ -14,6 +14,12 @@ type FormValues = {
url: string;
};
const defaultValues: FormValues = {
enabled: true,
name: '',
url: '',
};
type Props = {
closeModal: () => void;
onSubmit: (values: FormValues) => void;
@ -39,7 +45,13 @@ export const Form = ({
}: Props) => {
const { t } = useTranslation();
const methods = useForm({ defaultValues: initialValues });
const methods = useForm({
defaultValues: {
...defaultValues,
...initialValues,
},
mode: 'onBlur',
});
const { handleSubmit, control } = methods;
const openModal = (modalType: keyof typeof MODAL_TYPE, timeout = MODAL_OPEN_TIMEOUT) => {