-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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] Grouping logic is broken #19109
Comments
I like the proposal. The order seems to be preserved and the performance impact looks OK. The current logic only groups sequential options, but it should probably group them all. My only concern with your proposed solution is the usage of |
Could be implemented in another way, I was just illustrating the desired result 😄 Looping the array with |
🙂 Also be careful with this code, it will break on: const groupBy = () => 'toString' I'd suggest to use const indexByKey = Object.create(null) or a |
@oliviertassinari I am encountering a same problem in grouping. Tried to sort it but what I need to grouped are data with nested children on it. And I wanted it to be grouped by its parent node. Would this be possible using AutoComplete? data is like as follows:
with this kind of data it shows this error: Is there a way for me to have no duplicates and group them all by their specified parent? |
@jeunesseBurce Please ask support questions on StackOverflow |
Current Behavior 😯
Given a set of data and the
groupBy
functor:The logic as described here produces a grouping of:
Which either:
Expected Behavior 🤔
I expect that the grouping would look something like this:
Steps to Reproduce 🕹
Steps:
Context 🔦
The logic linked in "Current Behavior" is flawed, particularly this part:
A more contrived example:
Running the 'faulty' logic yields the result (which causes buggyness due to duplicate
key
):Replacing the logic with:
yields the correctly grouped options:
Your Environment 🌎
The text was updated successfully, but these errors were encountered: