You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But if I change the <FormikMuiTextField /> (import { TextField as MuiTextField } from "@mui/material")out for just a vanilla TextField from @mui/material, it "works". But this didn't seem like it was correct according to the documentation.
I also had to use: `const { touched, errors } = useFormikContext();` to give this autocomplete access to touched and errors from the formik context, which I didn't see in the docs. I hope I'm not missing something simple here, but is this expected behavior/syntax?
The text was updated successfully, but these errors were encountered:
Sadly I didn't. I I'm not using Formik on any forms that use autocomplete, due to this issue. I'm doing most validation manually. If you ever get it working or find a way around this, let me know!
Hi, this could be a bug but I want to make sure I'm not missing something. Whenever I use this code:
<Field name="name" component={Autocomplete} options={["client", "vendor", "employee", "other"]} getOptionLabel={(option) => option} style={{ width: 300 }} renderInput={(params) => ( <FormikMuiTextField {...params} // We have to manually set the corresponding fields on the input component name="name" error={touched["name"] && !!errors["name"]} helperText={errors["name"]} label="Autocomplete" variant="outlined" /> )} />
TypeError: Cannot read properties of undefined (reading 'onBlur')
at fieldToTextField (http://localhost:3000/static/js/bundle.js:112758:22)
at TextField (http://localhost:3000/static/js/bundle.js:112781:188)
at renderWithHooks (http://localhost:3000/static/js/bundle.js:138991:22)
at mountIndeterminateComponent (http://localhost:3000/static/js/bundle.js:142277:17)
at beginWork (http://localhost:3000/static/js/bundle.js:143573:20)
at HTMLUnknownElement.callCallback (http://localhost:3000/static/js/bundle.js:128583:18)
at Object.invokeGuardedCallbackDev (http://localhost:3000/static/js/bundle.js:128627:20)
at invokeGuardedCallback (http://localhost:3000/static/js/bundle.js:128684:35)
at beginWork$1 (http://localhost:3000/static/js/bundle.js:148558:11)
at performUnitOfWork (http://localhost:3000/static/js/bundle.js:147805:16)"
The text was updated successfully, but these errors were encountered: