[material-ui][Autocomplete] Adding custom props to slotProps.paper in AutoComplete throws an error #43609
Labels
component: autocomplete
This is the name of the generic UI component, not the React module!
enhancement
This is not a bug, nor a new feature
good first issue
Great for first contributions. Enable to learn the contribution process.
package: material-ui
Specific to @mui/material
ready to take
Help wanted. Guidance available. There is a high chance the change will be accepted
typescript
Steps to reproduce
Link to live example: (required)
https://stackblitz.com/edit/stackblitz-starters-szpsur?file=src%2FApp.tsx (In stackblitz it will work, however when using the same code locally it throws the error)
Steps:
slotProps.paper
in the AutoComplete componentCurrent behavior
You cant provide your own custom props (when you use the PaperComponent prop for example).
It throws an error because the prop does not exist on type PaperProps
Expected behavior
It would allow me to add custom props as i want, not just props that exists in PaperProps.
Context
I am trying to create a custom paper in the auto complete that has a "Select All" and "Deselect All" buttons, and for the buttons to work, I need to provide the onChange function and other props to the paper component.
but since the onChange function does not exist in paperProps, it throws me an error
Your environment
npx @mui/envinfo
Search keywords: Autocomplete , Paper , CustomProps
The text was updated successfully, but these errors were encountered: