[Autocomplete] Pass getOptionLabel as a parameter to renderOption
Netlify deploy preview
Bundle size report
Details of bundle changes (Toolpad) Details of bundle changes
Generated by :no_entry_sign: dangerJS against 4de3fc1d8fa72e8a4c8f43e9f6c0f8f1f76726ef
@ZeeshanTamboli please review
@ZeeshanTamboli i will now also add the same for Autocomplete in JoyUI. I've made the demo for material UI. Should I add a similar demo too for Joy UI?
You can check the demo here : demo
edit: renderOption of Autocomplete of JoyUI actually already has ownerState in the parameter. So I think I've done all of your review. Please re-review :)
@ZeeshanTamboli that is unfortunate, I didn't realize that. Personally I believe this demo is useful to show how you can easily customize the component for the whole app. I think it's important because one of the main reason people might be reluctant to use Material UI is that they might not really be too fond of Material Design and they don't know that Material UI is easily customizable like that.
It also showcases how to utilise ownerState. It's true that the API docs also explains it, but a quick glance on the demo with all the same styling might push user to find other alternative before finding the API.
As for using useTheme, I think a simple comment above it such as "to determine dark/light mode" should suffice. It might not be ideal, but the advantage far outweights the disadvantage.
@nicolas-ot I'm discussing it with the team and will inform you about the next steps.
If you want to research till then, this is how I did it recently in #36805.
@ZeeshanTamboli any update?
@ZeeshanTamboli any update?
@nicolas-ot We haven't found a solution yet because the demo creates a new theme. Let's go ahead by using the useTheme hook and adding a comment explaining its purpose in determining light/dark mode. Afterward, we can seek someone else's opinion on it.
I would do that, but would it be possible to seek someone's else opinion first before I actually implemented it? @ZeeshanTamboli
@michaldudak, what are your thoughts on this? I've talked to @siriwatknp about the demo theme, but we haven't found a solution yet. How do you propose we move forward?
I'm OK with useTheme, but let's also add a comment explaining why it's needed.
@ZeeshanTamboli I've changed it as discussed. Please review.
@ZeeshanTamboli I'm done updating. Please review again
please review @ZeeshanTamboli