Material-ui: Autocomplete grouBy + virtualization example, wrong groups

Created on 24 Apr 2020  路  6Comments  路  Source: mui-org/material-ui

Checking the example of autocomplete + virtualization. The groups are supposed to be the first letter of the item but they seem to be kind of random. See gif:

group-by

  • [x] The issue is present in the latest release.
  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 馃槸

When you open the autocomplete, first group seems to always be 0, but then subsequent groups seem to be off

Expected Behavior 馃

Item groups are named correctly

Steps to Reproduce 馃暪

see gif

Context 馃敠

Your Environment 馃寧

| Tech | Version |
| ----------- | ------- |
| Material-UI | v4.9.11 |

bug 馃悰 Autocomplete good first issue

Most helpful comment

I would love to submit a PR for this issue

All 6 comments

diff --git a/docs/src/pages/components/autocomplete/Virtualize.tsx b/docs/src/pages/components/autocomplete/Virtualize.tsx
index 2785133cb..92d571a60 100644
--- a/docs/src/pages/components/autocomplete/Virtualize.tsx
+++ b/docs/src/pages/components/autocomplete/Virtualize.tsx
@@ -110,7 +110,7 @@ const OPTIONS = Array.from(new Array(10000))

 const renderGroup = (params: RenderGroupParams) => [
   <ListSubheader key={params.key} component="div">
-    {params.key}
+    {params.group}
   </ListSubheader>,
   params.children,
 ];

@Janpot Well spotted, we have made a change to the args of renderGroup recently. We need to fix it :).

@oliviertassinari off-topic, what's your workflow for generating these diffs?

@Janpot I edit them in my locale env, check that it works, run git diff, copy, reset hard to master.

I would love to submit a PR for this issue

@Uneetpatel7 Feel free to :)

Was this page helpful?
0 / 5 - 0 ratings