[material-ui][Autocomplete] Passing slotProps
to the TextField
in renderInput
throws an error
#43573
Labels
bug 🐛
Something doesn't work
component: autocomplete
This is the name of the generic UI component, not the React module!
package: material-ui
Specific to @mui/material
Steps to reproduce
Link to live example: https://stackblitz.com/edit/react-1qmjam?file=Demo.tsx
Steps:
Autocomplete
to see the errorCurrent behavior
I found 2 strange behaviors
{ htmlInput: { ... } }
more padding is added and clicking in the input throws an error.{ input: { ... } }
theendAdornment
disappears and clicking in input doesn't open the list of options.Expected behavior
I expect to be able to use
slotProps.input
the same way I was usingInputProps
andslotProps.htmlInput
the same way I was usinginputProps
.Context
In our app we have an
Autocomplete
with a customendAdornment
. We are adding another adornment before the existing one to be exact. I was trying to migrate fromInputProps
andinputProps
toslotProps
since they became deprecated in MUI v6.Before migrating the code looked like this (which is still working in v6 but won't in v7):
After the migration the code looks like this:
Both adornments disappeared and the list of options isn't displaying on focus anymore.
Your environment
npx @mui/envinfo
Search keywords: Autocomplete slotProps
The text was updated successfully, but these errors were encountered: