mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-02-20 11:44:09 +08:00
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
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:
parent
5279124130
commit
09b15210ed
@ -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) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user