[Autocomplete] freeSolo
prop makes onChange
value type become T | string
#33093
Labels
component: autocomplete
This is the name of the generic UI component, not the React module!
package: material-ui
Specific to @mui/material
status: expected behavior
Does not imply the behavior is intended. Just that we know about it and can't work around it
Duplicates
Latest version
Current behavior 😯
When passing in a custom option type
Option
to the Autocomplete component andfreeSolo={true}
, theonChange
says the value can be of typeOption | string
instead of justOption
.Expected behavior 🤔
Type of value in
onChange
should just beOption
, notOption | string
.Steps to reproduce 🕹
https://codesandbox.io/s/freesolo-demo-material-ui-forked-sn8l5i?file=/demo.tsx
Context 🔦
I want the onChange to only be type
Option
Your environment 🌎
Latest mui and typescript. See codesandbox.
The text was updated successfully, but these errors were encountered: