diff --git a/src/components/form/AutocompleteField.tsx b/src/components/form/AutocompleteField.tsx index 918efb9..096a89e 100644 --- a/src/components/form/AutocompleteField.tsx +++ b/src/components/form/AutocompleteField.tsx @@ -35,7 +35,6 @@ export interface AutocompleteFieldProps< textFieldProps: Omit< TextFieldProps, | "name" - | "id" | "value" | "onChange" | "onBlur" @@ -67,7 +66,7 @@ const AutocompleteField = < FreeSolo, ChipComponent >): JSX.Element => { - const { name, required, ...otherTextFieldProps } = textFieldProps + const { id, name, required, ...otherTextFieldProps } = textFieldProps const dotPath = name.split(".") @@ -97,9 +96,9 @@ const AutocompleteField = < defaultValue={ meta.initialValue === "" ? undefined : meta.initialValue } - renderInput={({ id, ...otherParams }) => ( + renderInput={({ id: _, ...otherParams }) => ( { name: string formControlLabelProps: Omit @@ -25,6 +25,7 @@ export interface CheckboxFieldProps } const CheckboxField: FC = ({ + id, name, formControlLabelProps, required = false, @@ -59,7 +60,7 @@ const CheckboxField: FC = ({ control={ = ({ + id, repeatName, setValue, fieldProps, @@ -64,7 +64,7 @@ const TextField: FC< type={type} label={label ?? `Repeat ${name.replace("_", " ")}`} placeholder={placeholder ?? `Enter your ${name.replace("_", " ")} again`} - id={repeatName} + id={id ?? repeatName} name={repeatName} value={repeatValue} onChange={form.handleChange} diff --git a/src/components/form/TextField.tsx b/src/components/form/TextField.tsx index d1ccf08..305780e 100644 --- a/src/components/form/TextField.tsx +++ b/src/components/form/TextField.tsx @@ -12,7 +12,6 @@ import { getNestedProperty } from "../../utils/general" export type TextFieldProps = Omit< MuiTextFieldProps, | "name" - | "id" | "value" | "onChange" | "onBlur" @@ -28,6 +27,7 @@ export type TextFieldProps = Omit< // https://formik.org/docs/examples/with-material-ui const TextField: FC = ({ + id, name, schema, type = "text", @@ -61,7 +61,7 @@ const TextField: FC = ({ return (