Xamarin.forms: [Bug] Android - Grouped CollectionView with template selector - Removing all items from a group and adding them back to the group renders incorrectly

Created on 4 Aug 2020  路  3Comments  路  Source: xamarin/Xamarin.Forms

Description

Initially rendering a grouped list in the collectionview works as expected. If I remove the Items from the first group, the collection group shrinks as expected. When I add the removed Items back to the first list, it only renders the first cell and the rest of the cells look like they are from the second group. I was testing this with a template selector that has around 10 different data templates - I'm not sure if this really had anything to do with it.

Steps to Reproduce

  1. Create a few groups for your ItemSource. I was testing w/ groups of at least 10 items in each.
  2. Remove the Items from the first group.
  3. Add the Items back in.
  4. The collectionview only renders one cell and displays the cells from the second group below it.
  5. Scrolling below the second group and back up again fixes the issue.

Expected Behavior

Adding Items to an empty group will render them correctly - like iOS and UWP. If there is only one item in the group, it seems to render that correctly.

Actual Behavior

Odd rendering state.

Basic Information

  • Version with issue: 4.7.0.1239
  • Last known good version: n/a
  • IDE: Visual Studio
  • Platform Target Frameworks:

    • Android: 10

Screenshots

Reproduction Link

I'll need to set this up later.

Workaround

Scrolling into the second group and scrolling back into the first group fixes the issue.

collectionview in-progress bug

All 3 comments

I've added an issue11642 to the shared Issues list.
https://github.com/mjmostachetti/Xamarin.Forms/tree/bug/11642

Here are pictures of before and after toggling a group w/ the same backing data. The first group is not rendered correctly after clearing the list and replacing it w/ an identical group.
Screenshot_1596696714
Screenshot_1596696701

If you scroll the group out of the window and then back up it'll resize back to the original height

Are there any planned releases before 5.0.0? If so, it would be nice to get this in sooner. Thanks!

Was this page helpful?
0 / 5 - 0 ratings