-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[iOS] Fixed issue where group Header/Footer template was set to all items when IsGrouped was true for an ObservableCollection #29144
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
base: main
Are you sure you want to change the base?
Conversation
|
Hey there @@Tamilarasan-Paranthaman! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the issue where group header and footer templates were incorrectly applied and not updating as expected when the ObservableCollection’s IsGrouped property was true.
- Adds group header/footer template mappings for iOS in CollectionViewHandler2.iOS.cs.
- Updates ObservableGroupedSource.cs to only add groups that implement IEnumerable.
- Removes platform-specific mapping conditions in GroupableItemsViewHandler.cs.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Controls/src/Core/Handlers/Items2/CollectionViewHandler2.iOS.cs | Adds new mapping for group header/footer templates to support dynamic updates on iOS. |
| src/Controls/src/Core/Handlers/Items/iOS/ObservableGroupedSource.cs | Adjusts group source creation with a type-check to include only IEnumerable groups. |
| src/Controls/src/Core/Handlers/Items/GroupableItemsViewHandler.cs | Removes conditional mapping for group header/footer templates on certain platforms. |
|
|
||
| foreach (var group in source) | ||
| { | ||
| if (group is IEnumerable enumerable) |
Copilot
AI
Apr 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check 'if (group is IEnumerable enumerable)' may inadvertently treat strings as groups. Consider excluding strings (e.g., 'if (group is IEnumerable enumerable && !(group is string))') to prevent unintended behavior.
| if (group is IEnumerable enumerable) | |
| if (group is IEnumerable enumerable && !(group is string)) |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsuarezruiz , yes, the failures were caused by these changes. I have updated the fix and committed the changes. Could you please review them and let me know if you have any concerns? |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |


Issue 1: The group header and footer templates were not updating correctly when set at runtime.
Root Cause of the issue
Description of Change
Issue 2: After implementing the mapper for the group header and footer templates, those templates were incorrectly applied to all items when IsGrouped was set to true for an ObservableCollection.
Root Cause of the issue
Description of Change
Issues Fixed
Fixes #29141
Test Case
Tested the behaviour in the following platforms
Screenshot
Before-fix.mov
After-Fix.mov