This is a migrated thread and some comments may be shown as answers.

Autocomplete bug with groupBy

5 Answers 112 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Artem
Top achievements
Rank 1
Artem asked on 12 May 2020, 09:26 AM
When using groupBy in autocomplete first header takes from first element of array, not from "value" field. Fix it please!!! I dont want use crutch

5 Answers, 1 is accepted

Sort by
0
Martin Bechev
Telerik team
answered on 14 May 2020, 07:03 AM

Hi Artem,

Thank you for the provided feedback.

In general, the groupBy method groups the provided data according to the specified descriptor. I am not sure that I understand correctly the reported behavior, that is why I checked the AutoComplete grouping functionality in the following StackBlitz example but it works as expected on my side. The data is grouped correctly to the specified descriptor:

https://stackblitz.com/edit/angular-vvp3mc?file=app/app.component.ts

Please could you provide some more details on this case, or update the above StackBlitz example to a state that reproduces the issue. Thank you in advance.

Regards,
Martin
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Artem
Top achievements
Rank 1
answered on 14 May 2020, 07:17 AM

https://stackblitz.com/edit/angular-vvp3mc

In file code, if stackblitz doesn't work

0
Artem
Top achievements
Rank 1
answered on 15 May 2020, 06:40 AM
The link was bad, sorry, here new one
https://stackblitz.com/edit/angular-vvp3mc-4v583l
0
Martin Bechev
Telerik team
answered on 18 May 2020, 04:11 AM

Hi Artem,

Thank you for the provided additional details about this case.

It looks like that the first group does not behave as expected. I will consult this case with the our core development team and I will get back to you by the end of the day.

Please accept our apologies for the caused inconvenience while the problem is still present.

Regards,
Martin
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Accepted
Martin Bechev
Telerik team
answered on 18 May 2020, 10:45 AM

Hi Artem,

I consulted this behavior with the assigned developers and can say that the discussed behavior is expected in this case when the value field of the GroupResult and the subcategory field have different values. Generally speaking, the group header shows the current subcategory value according to the scroll.

The reason why the second group is different is that its value is captured from the value field of the GroupResult, but when the user scrolls down the list when there are a lot of items, the actual group is shown in the header (in this case subcategory) instead of the custom header.

https://stackblitz.com/edit/angular-vvp3mc-d2ylkt?file=app/app.component.ts

In order to show custom group headers the subcategory field of each item needs to be changed as well so the value and the subcategory to have identical values:

https://stackblitz.com/edit/angular-vvp3mc-jkbd43?file=app/app.component.ts

I hope this sheds some light on this case.

Regards,
Martin
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
AutoComplete
Asked by
Artem
Top achievements
Rank 1
Answers by
Martin Bechev
Telerik team
Artem
Top achievements
Rank 1
Share this question
or