CollectionView with grouping enabled shows duplicate childs after adding/removing a new child record
Description
Please refer attached screenshots
After adding a new child record at the top level group, the child records of all the other groups underneath are automatically manipulated leading to duplicate data under each group.
Steps to Reproduce
- Run the code from repo link provided below which will preload parent and child records on the collectionview.
- Tap on "Service4" under "Category2", say Yes on delete promt to remove it from collection. The item is programmatically removed but not reflected on the UI.
- Now tap on "Service2" under "Category1", say yes in the delete prompt.
- Now see the child items under "Category3" are duplicated.
Link to public reproduction project repository
https://github.com/boopathyraj25/MAUI.CollectionViewBugs
Version with bug
8.0.21
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 27 and up
Did you find any workaround?
No
Relevant log output
No response
/similarissues
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Open similar issues:
- CollectionView with grouping enabled doesn't reflect the change on UI when a child record is removed (#22158), similarity score: 0.86
- Moving items in grouped CollectionView is moving the wrong items (#21698), similarity score: 0.81
- CollectionView with grouping show duplicates groups or crash when adding/removing data on iOS and MacCatalyst (#17969), similarity score: 0.81
- Grouped CollectionView content/items overlaps on iOS when data changes or when pull to refresh data (#20336), similarity score: 0.78
- Using CollectionView IsGrouped="True" bound to ObservableCollection causes crash (#18481), similarity score: 0.78
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Can repro this issue at Android platform on the latest 17.10 Preview 6(8.0.21 & 8.0.14).
@jaosnz-rep Facing same issue for iOS @PureWeen
@boopathyraj25 I reproduced this and found a workaround. You can inherit from ObservableCollection instead of List in ServiceCatUIModel. Maybe this will help you.
Also, this error is still reproducible on Microsoft.Maui.Controls version 8.0.40