-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Autocomplete] Access default getOptionLabel
in renderOption
#38048
Comments
Actually, |
You are correct; there is a bug. We forgot to pass the default The addition of |
getOptionLabel
in renderOption
getOptionLabel
in renderOption
Also noticed that the internal |
@emlai Would you like to create a PR? |
No, we already have a workaround in place |
@ZeeshanTamboli |
@emlai, Which
Moreover, if you want to style based on |
Duplicates
Latest version
Summary 💡
We are overriding the default
renderOption
but we cannot accessgetOptionLabel
in the customrenderOption
function, to get the correct label.I propose exposing
getOptionLabel
via theownerState
parameter ofrenderOption
, i.e. adding it to this object:material-ui/packages/mui-material/src/Autocomplete/Autocomplete.js
Lines 484 to 495 in 6f7acbb
Examples 🌈
This is our component override:
Motivation 🔦
If this feature is not added, we would need to drop support for
getOptionLabel
in our lib in order to userenderOption
.The text was updated successfully, but these errors were encountered: