-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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] Fix useAutocomplete groupedOptions type #23854
[Autocomplete] Fix useAutocomplete groupedOptions type #23854
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this comment?
@oliviertassinari Yeah, that would work. Can we be explicit that "if the grouping feature is enabled" means that the
|
@ZachCMP Sure, it sounds good. |
@oliviertassinari Comment updated. I'm happy with it now. Let me know if there's anything else you'd like me to add to this PR |
@ZachCMP Thanks for the polish |
Also came across this problem today. waiting for the new build with this merged in 🙏 |
@HJain13 We will likely release this weekend. In the meantime, you could potentially use https://github.com/mui-org/material-ui/blob/next/CONTRIBUTING.md#how-can-i-use-a-change-that-wasnt-released-yet. |
Is this included in the most recent version? I'm experiencing this issue on |
@jackHedaya The most recent version is v5.0.0-alpha.21. |
Shouldn't the type here actually be conditional upon the type of the |
Question about this:
I had to update the demos to fix type errors caused by the type definition change. The current demos aren't explicit about the fact that
groupedOptions
changes shape whengroupBy
is provided; And their behavior will actually break without explanation if you do providegroupBy
touseAutocomplete
(Demo). With the type definition change, you do get type errors now if you don't handle the union type ongroupedOptions
, which is good, but I think it would be of benefit to add a bit more explanation of that behavior to the demos, as it seems a bit unexpected to me. I'm happy to do that, I'm just wondering what form you think would be appropriate. Would just a comment do? Would you want an example of how to actually handle the different types? Or something else? What do you think?Fixes #23846