Skip to content

[MacCatalyst] Fix CollectionView Header/Footer Not Expanding to Content Width#35213

Merged
kubaflo merged 3 commits into
dotnet:inflight/currentfrom
KarthikRajaKalaimani:fix-35113
May 5, 2026
Merged

[MacCatalyst] Fix CollectionView Header/Footer Not Expanding to Content Width#35213
kubaflo merged 3 commits into
dotnet:inflight/currentfrom
KarthikRajaKalaimani:fix-35113

Conversation

@KarthikRajaKalaimani
Copy link
Copy Markdown
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Issue Details:

CollectionView's Header / Footer is not expanded to its content width in iOS and Mac platform

Root Cause:

In the iOS/MacCatalyst CollectionView2 implementation, StructuredItemsViewController2 and GroupableItemsViewController2 both have a GetViewForSupplementaryElement() method responsible for creating header and footer views. When a TemplatedCell2 is dequeued as a supplementary view, its ScrollDirection property was never set — it silently defaulted to UICollectionViewScrollDirection.Vertical. This was an oversight, because regular item cells in GetCell() already correctly assigned ScrollDirection. The missing assignment fed through to GetMeasureConstraints() in TemplatedCell2, which uses ScrollDirection to decide how to constrain the cell during measurement: for a horizontal grid, a Vertical direction incorrectly constrains the cell's width to the estimated value (~30pt from LayoutFactory2) instead of leaving it unconstrained, causing header/footer labels to be clipped to a tiny width and become inaccessible in the UI tree.

Description of Change:

The fix is a one-line addition in each of the two affected view controllers, mirroring the pattern already used in GetCell(). In StructuredItemsViewController2.GetViewForSupplementaryElement(), templatedCell.ScrollDirection = ScrollDirection is set before calling UpdateTemplatedSupplementaryView. The same line is added in GroupableItemsViewController2.GetViewForSupplementaryElement() for group header/footer cells. With ScrollDirection correctly propagated, GetMeasureConstraints() leaves the width unconstrained for horizontal grids, allowing headers and footers to self-size to their full content width. Vertical layouts are unaffected since they already defaulted to Vertical, and the change has no impact on Android or Windows as Items2 is iOS/MacCatalyst-only.

**Tested the behavior in the following platforms: **

  • Android
  • Windows
  • iOS
  • Mac

Reference:

N/A

Issues Fixed:

Fixes #35113

Screenshots

Before After
After_31553

@github-actions
Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 35213

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 35213"

@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label Apr 29, 2026
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Hey there @@KarthikRajaKalaimani! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Apr 29, 2026
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman changed the title Fix CollectionView's Header / Footer is not expanded to its content width in iOS and Mac platform [iOS][MacCatalyst] Fix CollectionView Header/Footer Not Expanding to Content Width Apr 29, 2026
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman added platform/macos macOS / Mac Catalyst platform/ios area-controls-collectionview CollectionView, CarouselView, IndicatorView collectionview-cv2 and removed platform/ios labels Apr 29, 2026
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman changed the title [iOS][MacCatalyst] Fix CollectionView Header/Footer Not Expanding to Content Width [MacCatalyst] Fix CollectionView Header/Footer Not Expanding to Content Width Apr 29, 2026
Copy link
Copy Markdown
Collaborator

@MauiBot MauiBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expert Review — 1 findings

See inline comments for details.

@MauiBot MauiBot added s/agent-approved AI agent recommends approval - PR fix is correct and optimal s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) labels Apr 29, 2026
Copy link
Copy Markdown
Contributor

@kubaflo kubaflo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it ready? :)

Copy link
Copy Markdown
Collaborator

@MauiBot MauiBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expert Review — 3 findings

See inline comments for details.

@dotnet dotnet deleted a comment from MauiBot May 4, 2026
@dotnet dotnet deleted a comment from MauiBot May 4, 2026
@dotnet dotnet deleted a comment from MauiBot May 4, 2026
@dotnet dotnet deleted a comment from MauiBot May 4, 2026
@MauiBot
Copy link
Copy Markdown
Collaborator

MauiBot commented May 4, 2026

🤖 AI Summary

👋 @KarthikRajaKalaimani — new AI review results are available. Please review the latest session below.

📊 Review Sessiona981495 · added test case for footer · 2026-05-04 09:56 UTC
🚦 Gate — Test Before & After Fix

Gate Result: ✅ PASSED

Platform: CATALYST · Base: main · Merge base: 1463c4c5

Test Without Fix (expect FAIL) With Fix (expect PASS)
🖥️ Issue35113 Issue35113 ✅ FAIL — 113s ✅ PASS — 82s
🔴 Without fix — 🖥️ Issue35113: FAIL ✅ · 113s
  Determining projects to restore...
  Restored /Users/cloudtest/vss/_work/1/s/src/Graphics/src/Graphics/Graphics.csproj (in 537 ms).
  Restored /Users/cloudtest/vss/_work/1/s/src/Essentials/src/Essentials.csproj (in 4.78 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/Controls/Foldable/src/Controls.Foldable.csproj (in 5.04 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/Core/Controls.Core.csproj (in 4.38 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/BlazorWebView/src/Maui/Microsoft.AspNetCore.Components.WebView.Maui.csproj (in 5.05 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/Core/src/Core.csproj (in 5.04 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/Controls/Maps/src/Controls.Maps.csproj (in 5.05 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/Core/maps/src/Maps.csproj (in 5.05 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/Xaml/Controls.Xaml.csproj (in 5.07 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj (in 5.13 sec).
  1 of 11 projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Graphics -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Graphics/Debug/net10.0-maccatalyst26.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Essentials -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Essentials/Debug/net10.0-maccatalyst26.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Core/Debug/net10.0-maccatalyst26.0/Microsoft.Maui.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Maps -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Maps/Debug/net10.0-maccatalyst26.0/Microsoft.Maui.Maps.dll
  Controls.BindingSourceGen -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Controls.Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-maccatalyst26.0/Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Controls.Maps -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-maccatalyst26.0/Microsoft.Maui.Controls.Maps.dll
  Microsoft.AspNetCore.Components.WebView.Maui -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-maccatalyst26.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
  Controls.Foldable -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-maccatalyst26.0/Microsoft.Maui.Controls.Foldable.dll
  Controls.Xaml -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-maccatalyst26.0/Microsoft.Maui.Controls.Xaml.dll
  Detected signing identity:
    Code Signing Key: "" (-)
    Provisioning Profile: "" () - no entitlements
    Bundle Id: com.microsoft.maui.uitests
    App Id: com.microsoft.maui.uitests
  Detected signing identity:
    Code Signing Key: "" (-)
    Provisioning Profile: "" () - no entitlements
    Bundle Id: com.microsoft.maui.uitests
    App Id: com.microsoft.maui.uitests
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Controls.TestCases.HostApp -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-maccatalyst/maccatalyst-x64/Controls.TestCases.HostApp.dll
  Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
  Optimizing assemblies for size. This process might take a while.
  Detected signing identity:
    Code Signing Key: "" (-)
    Provisioning Profile: "" () - no entitlements
    Bundle Id: com.microsoft.maui.uitests
    App Id: com.microsoft.maui.uitests
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Controls.TestCases.HostApp -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-maccatalyst/maccatalyst-arm64/Controls.TestCases.HostApp.dll
  Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
  Optimizing assemblies for size. This process might take a while.

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:01:03.20
  Determining projects to restore...
  Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/VisualTestUtils/VisualTestUtils.csproj (in 3.53 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/UITest.Core/UITest.Core.csproj (in 3.5 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/Controls/tests/CustomAttributes/Controls.CustomAttributes.csproj (in 3.53 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/UITest.NUnit/UITest.NUnit.csproj (in 3.64 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/UITest.Appium/UITest.Appium.csproj (in 4.06 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/UITest.Analyzers/UITest.Analyzers.csproj (in 4.81 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/VisualTestUtils.MagickNet/VisualTestUtils.MagickNet.csproj (in 4.96 sec).
  Restored /Users/cloudtest/vss/_work/1/s/src/Controls/tests/TestCases.Mac.Tests/Controls.TestCases.Mac.Tests.csproj (in 4.98 sec).
  5 of 13 projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Controls.CustomAttributes -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.CustomAttributes/Debug/net10.0/Controls.CustomAttributes.dll
  Graphics -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Graphics/Debug/net10.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Essentials -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Core/Debug/net10.0/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Controls.Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Core/Debug/net10.0/Microsoft.Maui.Controls.dll
  UITest.Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.Core/Debug/net10.0/UITest.Core.dll
  VisualTestUtils -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/VisualTestUtils/Debug/netstandard2.0/VisualTestUtils.dll
  VisualTestUtils.MagickNet -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/VisualTestUtils.MagickNet/Debug/netstandard2.0/VisualTestUtils.MagickNet.dll
  UITest.NUnit -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.NUnit/Debug/net10.0/UITest.NUnit.dll
  UITest.Appium -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.Appium/Debug/net10.0/UITest.Appium.dll
  UITest.Analyzers -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.Analyzers/Debug/netstandard2.0/UITest.Analyzers.dll
  Controls.TestCases.Mac.Tests -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.Mac.Tests/Debug/net10.0/Controls.TestCases.Mac.Tests.dll
Test run for /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.Mac.Tests/Debug/net10.0/Controls.TestCases.Mac.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (arm64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
/Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.Mac.Tests/Debug/net10.0/Controls.TestCases.Mac.Tests.dll
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.04]   Discovering: Controls.TestCases.Mac.Tests
[xUnit.net 00:00:00.14]   Discovered:  Controls.TestCases.Mac.Tests
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.Mac.Tests/Debug/net10.0/Controls.TestCases.Mac.Tests.dll
   NUnit3TestExecutor discovered 2 of 2 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 5/4/2026 2:00:51 AM FixtureSetup for Issue35113(Mac)
>>>>> 5/4/2026 2:00:51 AM HorizontalGridFooterExpandsToContentWidth Start
>>>>> 5/4/2026 2:00:55 AM HorizontalGridFooterExpandsToContentWidth Stop
>>>>> 5/4/2026 2:00:55 AM Log types: 
  Failed HorizontalGridFooterExpandsToContentWidth [4 s]
  Error Message:
     Footer width 24 should be > 100 when fully expanded. If ~30, ScrollDirection was not set on the supplementary TemplatedCell2.
Assert.That(rect.Width, Is.GreaterThan(100))
  Expected: greater than 100
  But was:  24

  Stack Trace:
     at Microsoft.Maui.TestCases.Tests.Issues.Issue35113.HorizontalGridFooterExpandsToContentWidth() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue35113.cs:line 38

1)    at Microsoft.Maui.TestCases.Tests.Issues.Issue35113.HorizontalGridFooterExpandsToContentWidth() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue35113.cs:line 38


>>>>> 5/4/2026 2:00:56 AM HorizontalGridHeaderExpandsToContentWidth Start
>>>>> 5/4/2026 2:00:56 AM HorizontalGridHeaderExpandsToContentWidth Stop
>>>>> 5/4/2026 2:00:56 AM Log types: 
  Failed HorizontalGridHeaderExpandsToContentWidth [837 ms]
  Error Message:
     Header width 24 should be > 100 when fully expanded. If ~30, ScrollDirection was not set on the supplementary TemplatedCell2.
Assert.That(rect.Width, Is.GreaterThan(100))
  Expected: greater than 100
  But was:  24

  Stack Trace:
     at Microsoft.Maui.TestCases.Tests.Issues.Issue35113.HorizontalGridHeaderExpandsToContentWidth() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue35113.cs:line 25

1)    at Microsoft.Maui.TestCases.Tests.Issues.Issue35113.HorizontalGridHeaderExpandsToContentWidth() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue35113.cs:line 25


NUnit Adapter 4.5.0.0: Test execution complete

Total tests: 2
     Failed: 2
Test Run Failed.
 Total time: 18.5878 Seconds

🟢 With fix — 🖥️ Issue35113: PASS ✅ · 82s
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Graphics -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Graphics/Debug/net10.0-maccatalyst26.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Essentials -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Essentials/Debug/net10.0-maccatalyst26.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Core/Debug/net10.0-maccatalyst26.0/Microsoft.Maui.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Controls.BindingSourceGen -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  Maps -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Maps/Debug/net10.0-maccatalyst26.0/Microsoft.Maui.Maps.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Controls.Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-maccatalyst26.0/Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Controls.Maps -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-maccatalyst26.0/Microsoft.Maui.Controls.Maps.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Controls.Xaml -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-maccatalyst26.0/Microsoft.Maui.Controls.Xaml.dll
  Microsoft.AspNetCore.Components.WebView.Maui -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-maccatalyst26.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Controls.Foldable -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-maccatalyst26.0/Microsoft.Maui.Controls.Foldable.dll
  Detected signing identity:
    Code Signing Key: "" (-)
    Provisioning Profile: "" () - no entitlements
    Bundle Id: com.microsoft.maui.uitests
    App Id: com.microsoft.maui.uitests
  Detected signing identity:
    Code Signing Key: "" (-)
    Provisioning Profile: "" () - no entitlements
    Bundle Id: com.microsoft.maui.uitests
    App Id: com.microsoft.maui.uitests
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Controls.TestCases.HostApp -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-maccatalyst/maccatalyst-x64/Controls.TestCases.HostApp.dll
  Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
  Optimizing assemblies for size. This process might take a while.
  Detected signing identity:
    Code Signing Key: "" (-)
    Provisioning Profile: "" () - no entitlements
    Bundle Id: com.microsoft.maui.uitests
    App Id: com.microsoft.maui.uitests
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Controls.TestCases.HostApp -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-maccatalyst/maccatalyst-arm64/Controls.TestCases.HostApp.dll
  Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
  Optimizing assemblies for size. This process might take a while.

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:51.22
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Controls.CustomAttributes -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.CustomAttributes/Debug/net10.0/Controls.CustomAttributes.dll
  Graphics -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Graphics/Debug/net10.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Essentials -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Core/Debug/net10.0/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14005749
  Controls.Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Core/Debug/net10.0/Microsoft.Maui.Controls.dll
  VisualTestUtils -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/VisualTestUtils/Debug/netstandard2.0/VisualTestUtils.dll
  VisualTestUtils.MagickNet -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/VisualTestUtils.MagickNet/Debug/netstandard2.0/VisualTestUtils.MagickNet.dll
  UITest.Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.Core/Debug/net10.0/UITest.Core.dll
  UITest.NUnit -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.NUnit/Debug/net10.0/UITest.NUnit.dll
  UITest.Appium -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.Appium/Debug/net10.0/UITest.Appium.dll
  UITest.Analyzers -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.Analyzers/Debug/netstandard2.0/UITest.Analyzers.dll
  Controls.TestCases.Mac.Tests -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.Mac.Tests/Debug/net10.0/Controls.TestCases.Mac.Tests.dll
Test run for /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.Mac.Tests/Debug/net10.0/Controls.TestCases.Mac.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (arm64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
/Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.Mac.Tests/Debug/net10.0/Controls.TestCases.Mac.Tests.dll
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.05]   Discovering: Controls.TestCases.Mac.Tests
[xUnit.net 00:00:00.15]   Discovered:  Controls.TestCases.Mac.Tests
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.Mac.Tests/Debug/net10.0/Controls.TestCases.Mac.Tests.dll
   NUnit3TestExecutor discovered 2 of 2 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 5/4/2026 2:02:14 AM FixtureSetup for Issue35113(Mac)
>>>>> 5/4/2026 2:02:14 AM HorizontalGridFooterExpandsToContentWidth Start
>>>>> 5/4/2026 2:02:18 AM HorizontalGridFooterExpandsToContentWidth Stop
  Passed HorizontalGridFooterExpandsToContentWidth [4 s]
>>>>> 5/4/2026 2:02:18 AM HorizontalGridHeaderExpandsToContentWidth Start
>>>>> 5/4/2026 2:02:18 AM HorizontalGridHeaderExpandsToContentWidth Stop
  Passed HorizontalGridHeaderExpandsToContentWidth [601 ms]
NUnit Adapter 4.5.0.0: Test execution complete

Test Run Successful.
Total tests: 2
     Passed: 2
 Total time: 11.7666 Seconds

📁 Fix files reverted (3 files)
  • eng/pipelines/ci-copilot.yml
  • src/Controls/src/Core/Handlers/Items2/iOS/GroupableItemsViewController2.cs
  • src/Controls/src/Core/Handlers/Items2/iOS/StructuredItemsViewController2.cs

🧪 UI Tests — Category Detection

Detected UI test categories: CollectionView


🔍 Regression Cross-Reference

🔍 Regression Cross-Reference

🟢 No regression risks detected. No labeled bug-fix PRs in the last 6 months touched the modified files.


🔍 Pre-Flight — Context & Validation

Issue: #35113 - [MacOS][CV2] I8_View header and footer_Horizontal_View - Footer on the right doesn't adapt when resizing the window
PR: #35213 - [MacCatalyst] Fix CollectionView Header/Footer Not Expanding to Content Width
Platforms Affected: iOS, macOS (MacCatalyst) — CV2 (Items2/) only
Files Changed: 2 implementation, 2 test

Key Findings

  • TemplatedCell2.GetMeasureConstraints() branches on ScrollDirection to decide which dimension is unconstrained. For a horizontal grid, Vertical (the wrong default) constrains width to preferredAttributes.Size.Width (~30pt estimated), clipping header/footer content.
  • GetCell() in ItemsViewController2 already sets templatedCell.ScrollDirection = ScrollDirection before binding — supplementary view methods did not, causing inconsistency.
  • Fix adds one line in StructuredItemsViewController2.GetViewForSupplementaryElement() and one in GroupableItemsViewController2.GetViewForSupplementaryElement(), restoring parity with GetCell().
  • PrepareForReuse() does not reset ScrollDirection, so every dequeue path now explicitly sets it — reuse is safe.
  • Tests added: two UI tests (HorizontalGridHeaderExpandsToContentWidth, HorizontalGridFooterExpandsToContentWidth) verifying GetRect().Width > 100pt on a horizontal GridItemsLayout.
  • Gate: ✅ PASSED — tests FAIL without fix, PASS with fix.

Code Review Summary

Verdict: LGTM
Confidence: high
Errors: 0 | Warnings: 0 | Suggestions: 1

Key code review findings:

  • 💡 A paired vertical-layout test for header/footer sizing would guard against future regressions in the Vertical branch, but is not required to merge.

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #35213 Add templatedCell.ScrollDirection = ScrollDirection before UpdateTemplatedSupplementaryView in both view controllers ✅ PASSED (Gate) StructuredItemsViewController2.cs, GroupableItemsViewController2.cs Mirrors existing pattern in GetCell()

🔬 Code Review — Deep Analysis

Code Review — PR #35213

Independent Assessment

What this changes: Adds templatedCell.ScrollDirection = ScrollDirection in two GetViewForSupplementaryElement() overrides — one in StructuredItemsViewController2 (for top-level header/footer) and one in GroupableItemsViewController2 (for group header/footer). This propagates the collection view's scroll direction to the supplementary TemplatedCell2 before it performs measurement.

Inferred motivation: TemplatedCell2.GetMeasureConstraints() branches on ScrollDirection to decide which dimension to leave unconstrained:

var constraints = ScrollDirection == UICollectionViewScrollDirection.Vertical
    ? new Size(preferredAttributes.Size.Width, double.PositiveInfinity)
    : new Size(double.PositiveInfinity, preferredAttributes.Size.Height);

Without the fix, ScrollDirection on supplementary cells defaulted to Vertical. A horizontal grid's header/footer cell was therefore measured with its width constrained to preferredAttributes.Size.Width — an estimated value of ~30pt from LayoutFactory2 — causing the content to be clipped and invisible in the accessibility tree. Regular item cells had this assignment correct (in GetCell()). Supplementary cells were missed.


Reconciliation with PR Narrative

Author claims: "ScrollDirection was never set on supplementary TemplatedCell2 cells — it silently defaulted to Vertical. The fix is a one-line addition in each of the two view controllers, mirroring the pattern already used in GetCell()."

Agreement: The root cause analysis is exactly correct. The fix location, placement, and approach all match what an ideal fix looks like. There are no deviations between the code and the author's description.


Findings

No ❌ errors or ⚠️ warnings found. The following minor observations are recorded for completeness:

💡 Suggestion — Vertical-layout regression test not present

The fix sets ScrollDirection explicitly for both horizontal and vertical layouts. Vertical was already the default, so there's no behavior change, but a paired test for ItemsLayoutOrientation.Vertical header/footer sizing would guard against future regressions in that path.

This is a "nice to have" — the existing regression test fully covers the reported bug, and adding a vertical test is not required to merge.


Dimension Analysis

Dimensions activated by file paths: CollectionView iOS/MacCatalyst (Items2/), Layout Measure-Arrange, Logic and Correctness, Regression Prevention, Performance-Critical Path.

Dimension Result
CollectionView iOS/MacCatalyst (Items2/) ✅ Fix targets Items2/ — the active iOS/Mac handler. Pre-existing Items/ iOS paths not touched. Placement of ScrollDirection assignment is before Bind()InvalidateMeasure() is called, so direction is set before the first measurement cycle. Cell reuse is safe: PrepareForReuse() does not reset ScrollDirection; the assignment happens on every dequeue from either GetCell() or GetViewForSupplementaryElement().
Layout Measure-Arrange GetMeasureConstraints() now receives the correct direction for supplementary cells. For horizontal grids: width → +∞, height → preferredAttributes.Size.Height. For vertical layouts: width → preferredAttributes.Size.Width, height → +∞. This was already correct for regular item cells; now consistent for supplementary cells.
Logic and Correctness ✅ No inverted conditions. Assignment is placed on line 90/105 in both files before the corresponding UpdateTemplated...() call, which is the correct ordering.
Regression Prevention ✅ Regression test (Issue35113) covers the exact bug scenario: horizontal GridItemsLayout + templated header/footer Labels with no explicit WidthRequest. Width assertion of > 100 pt directly captures the reported ~30pt symptom. App.ScrollTo("Issue35113Footer") ensures the footer is on-screen before querying its rect. Regression check shows no revert risks (risks.jsonCLEAN).
Performance-Critical Path ✅ Assignment of a single property to a UICollectionViewScrollDirection enum. Zero allocation, zero JNI, not on any measure/arrange hot path.
Public API ✅ No public API changes.
Cross-Platform ✅ Items2/ is iOS/MacCatalyst-only by definition. Android uses Items/Android, Windows uses Items/Windows. No other platforms affected.

CI Status

All required checks pass ✅ (maui-pr and all sub-jobs including iOS/macOS device tests, Helix unit tests, integration tests across all platforms).


Devil's Advocate

"Could setting ScrollDirection on a recycled supplementary cell break the vertical case?"
No. For vertical layouts, ScrollDirection was already Vertical (the default) on all newly allocated cells. The explicit assignment in GetViewForSupplementaryElement() writes the same value. No behavioral change for vertical.

"Does PrepareForReuse() need to reset ScrollDirection?"
Not needed. Every code path that dequeues a TemplatedCell2 — both GetCell() and GetViewForSupplementaryElement() — now sets ScrollDirection before any measurement. A stale value from a prior use is always overwritten before the cell is used.

"Could the GroupableItemsViewController2 path regress something? It now touches group header cells which are a different code path."
The delegate chain for group headers already dequeued the correct (Horizontal/Vertical) supplementary view type via DetermineViewReuseId() — that part was working. The missing piece was that the dequeued cell's ScrollDirection property wasn't updated. The fix is symmetric with the StructuredItemsViewController2 fix and with GetCell().

"Is the test too simple — could it pass trivially on non-iOS platforms?"
The test uses CollectionView2 which on non-iOS platforms would still provide a header/footer that expands to content width (no bug on Android/Windows). A pass on those platforms is a genuine pass, not a vacuous pass.


Verdict: LGTM

Confidence: high

Summary: The PR is a minimal, targeted fix that adds one missing line of property assignment in two view controllers, precisely mirroring the pattern already established in GetCell(). The root cause analysis is correct, the placement is correct, the regression test covers the reported scenario faithfully, and CI is fully green. No changes requested.


🔧 Fix — Analysis & Comparison

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #35213 Add before in (both controllers) PASSED (Gate) StructuredItemsViewController2.cs, GroupableItemsViewController2.cs Mirrors pattern from GetCell()
1 try-fix-1 Set inside in both controllers PASS StructuredItemsViewController2.cs, GroupableItemsViewController2.cs More ensures ScrollDirection set on every update
2 try-fix-2 Self-contained detection in TemplatedCell2.GetMeasureConstraints() via PlatformHandler.VirtualView.Parent chain when isSupplementaryView==true PASS TemplatedCell2.cs No controller changes needed; walks MAUI virtual view tree
3 try-fix-3 Add virtual SetupSupplementaryCell() to ItemsViewController2 base class; call from both derived controllers PASS ItemsViewController2.cs + 2 controllers Consolidates pattern into shared virtual method in base class
layout PASS TemplatedCell2.cs UIKit-native; self-healing without MAUI view chain dependency

Cross-Pollination

Model Round New Ideas? Details
claude-haiku-4.5 2 Variant only Lazy-initialized cached ScrollDirection derivative of try-fix-4, not fundamentally different

Exhausted: Yes
Selected Fix: PR's fix is most minimal and pattern-consistent; try-fix-1 is slightly more defensive; try-fix-3 is architecturally cleanest. See report for full comparison.


📋 Report — Final Recommendation

✅ Final Recommendation: APPROVE

Phase Status

Phase Status Notes
Pre-Flight ✅ COMPLETE Issue #35113, PR #35213, 2 impl + 2 test files, catalyst/iOS
Code Review LGTM (high) 0 errors, 0 warnings, 1 suggestion (vertical regression test)
Gate ✅ PASSED MacCatalyst — tests FAIL without fix, PASS with fix
Try-Fix ✅ COMPLETE 4 attempts, 4 passing
Report ✅ COMPLETE

Code Review Impact on Try-Fix

Code review found LGTM with zero errors or warnings — no errors drove fix exploration. The single 💡 suggestion (add vertical-layout regression test) was applied in the pr-plus-reviewer candidate. Code review findings confirmed the PR's root cause analysis was correct, so try-fix models focused on exploring structurally different fix placements (inside vs. outside methods, base class vs. derived class, controller vs. cell layer) rather than fixing code-review errors.

Candidate Comparison

Rank Candidate Tests Approach Simplicity Pattern Fit Notes
🥇 1 pr-plus-reviewer PR fix + vertical regression test Minimal ✅ Exact Best overall: all PR benefits + regression guard
🥈 2 pr 1-line-per-controller in GetViewForSupplementaryElement() Minimal (2 lines) ✅ Exact Clean, mirrors GetCell() exactly
🥉 3 try-fix-1 Set inside UpdateTemplatedSupplementaryView() Minimal (2 lines) ✅ Close Slightly more defensive; functionally equivalent
4 try-fix-3 Virtual SetupSupplementaryCell() in base class 3 files changed ✅ Good Architecturally cleanest but adds API surface
5 try-fix-2 Auto-detect in GetMeasureConstraints() via MAUI VirtualView chain TemplatedCell2 only ⚠️ Adds complexity Works but couples cell to MAUI type hierarchy at measure time
6 try-fix-4 UIKit hierarchy read in GetMeasureConstraints() with ObjC exception guard TemplatedCell2 only ⚠️ Adds complexity Defensive/self-healing but over-engineered for a one-line root cause

Selected Fix: PR's fix (pr-plus-reviewer — PR fix + vertical regression test added by reviewer)

Summary

PR #35213 fixes a one-line omission in two iOS/MacCatalyst Items2 view controllers: ScrollDirection was being set on TemplatedCell2 when dequeuing regular item cells (GetCell()) but was missed for supplementary views (GetViewForSupplementaryElement()). The code review confirmed the fix is minimal, correct, and pattern-consistent. All 4 try-fix alternatives also passed, but are either equivalent (try-fix-1), more complex (try-fix-2, try-fix-4), or touch more files (try-fix-3). The pr-plus-reviewer candidate improves on the PR by adding a vertical-layout regression test recommended by the expert reviewer.

Root Cause

TemplatedCell2.GetMeasureConstraints() branches on ScrollDirection to decide which dimension is unconstrained. For supplementary cells in a horizontal grid, ScrollDirection defaulted to Vertical, constraining width to preferredAttributes.Size.Width (~30pt estimated by LayoutFactory2). This caused header/footer content to be clipped and invisible in the accessibility tree. The same assignment was already present in GetCell() — the supplementary code paths were simply missed.

Fix Quality

Excellent. The fix is a one-line addition in each of two symmetric code locations. It directly mirrors the already-established pattern in GetCell() at the exact right point in the call sequence (before UpdateTemplatedSupplementaryView()). No behavioral change for vertical layouts (Vertical was already the default). Tests faithfully capture the reported symptom (width assertion > 100pt vs. ~30pt). CI green. No API changes.


@sheiksyedm sheiksyedm marked this pull request as ready for review May 5, 2026 08:23
Copilot AI review requested due to automatic review settings May 5, 2026 08:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a CV2 (Items2) iOS/MacCatalyst layout measurement bug where CollectionView header/footer supplementary templated cells were measured with the wrong scroll direction, causing overly constrained width in horizontal layouts.

Changes:

  • Propagate ScrollDirection to TemplatedCell2 when used as a supplementary header/footer in StructuredItemsViewController2 and GroupableItemsViewController2.
  • Add a HostApp reproduction page for issue #35113 using a horizontal GridItemsLayout.
  • Add Appium UI tests asserting header/footer width expands beyond a minimum threshold.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue35113.cs Adds UI tests validating header/footer width behavior for a horizontal CollectionView2 grid.
src/Controls/tests/TestCases.HostApp/Issues/Issue35113.cs Adds a minimal repro page with header/footer labels in a horizontal grid CollectionView2.
src/Controls/src/Core/Handlers/Items2/iOS/StructuredItemsViewController2.cs Sets templatedCell.ScrollDirection for header/footer supplementary views before updating/binding.
src/Controls/src/Core/Handlers/Items2/iOS/GroupableItemsViewController2.cs Sets TemplatedCell2.ScrollDirection for grouped header/footer supplementary views before updating/binding.

Comment on lines +35 to +37
App.ScrollTo("Issue35113Footer");
App.WaitForElement("Issue35113Footer");
var rect = App.FindElement("Issue35113Footer").GetRect();
Comment on lines 100 to 106
{
case DefaultCell2 DefaultCell2:
UpdateDefaultSupplementaryView(DefaultCell2, elementKind, indexPath);
break;
case TemplatedCell2 TemplatedCell2:
TemplatedCell2.ScrollDirection = ScrollDirection;
UpdateTemplatedSupplementaryView(TemplatedCell2, elementKind, indexPath);
@kubaflo kubaflo changed the base branch from main to inflight/current May 5, 2026 09:43
@kubaflo kubaflo merged commit bdc9a16 into dotnet:inflight/current May 5, 2026
25 of 41 checks passed
@github-actions github-actions Bot added this to the .NET 10 SR7 milestone May 5, 2026
github-actions Bot pushed a commit that referenced this pull request May 6, 2026
…nt Width (#35213)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Issue Details:

CollectionView's Header / Footer is not expanded to its content width in
iOS and Mac platform
       
### Root Cause:

In the iOS/MacCatalyst CollectionView2 implementation,
StructuredItemsViewController2 and GroupableItemsViewController2 both
have a GetViewForSupplementaryElement() method responsible for creating
header and footer views. When a TemplatedCell2 is dequeued as a
supplementary view, its ScrollDirection property was never set — it
silently defaulted to UICollectionViewScrollDirection.Vertical. This was
an oversight, because regular item cells in GetCell() already correctly
assigned ScrollDirection. The missing assignment fed through to
GetMeasureConstraints() in TemplatedCell2, which uses ScrollDirection to
decide how to constrain the cell during measurement: for a horizontal
grid, a Vertical direction incorrectly constrains the cell's width to
the estimated value (~30pt from LayoutFactory2) instead of leaving it
unconstrained, causing header/footer labels to be clipped to a tiny
width and become inaccessible in the UI tree.

### Description of Change:

The fix is a one-line addition in each of the two affected view
controllers, mirroring the pattern already used in GetCell(). In
StructuredItemsViewController2.GetViewForSupplementaryElement(),
templatedCell.ScrollDirection = ScrollDirection is set before calling
UpdateTemplatedSupplementaryView. The same line is added in
GroupableItemsViewController2.GetViewForSupplementaryElement() for group
header/footer cells. With ScrollDirection correctly propagated,
GetMeasureConstraints() leaves the width unconstrained for horizontal
grids, allowing headers and footers to self-size to their full content
width. Vertical layouts are unaffected since they already defaulted to
Vertical, and the change has no impact on Android or Windows as Items2
is iOS/MacCatalyst-only.

**Tested the behavior in the following platforms: **

- [ ] Android
- [ ] Windows
- [x] iOS
- [x] Mac

### Reference:

N/A

### Issues Fixed:

Fixes #35113            

### Screenshots
| Before  | After  |
|---------|--------|
| <img width="400" height="500"
src="https://github.com/user-attachments/assets/319d97f0-a4b9-4b00-bc9a-670fd44fd86f"
/> | <img width="400" height="500" alt="After_31553"
src="https://github.com/user-attachments/assets/710a0fca-0c92-48fd-a91f-697d9e0d6b86"
/> |
@kubaflo kubaflo added the s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix) label May 20, 2026
PureWeen pushed a commit that referenced this pull request Jun 2, 2026
…nt Width (#35213)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Issue Details:

CollectionView's Header / Footer is not expanded to its content width in
iOS and Mac platform
       
### Root Cause:

In the iOS/MacCatalyst CollectionView2 implementation,
StructuredItemsViewController2 and GroupableItemsViewController2 both
have a GetViewForSupplementaryElement() method responsible for creating
header and footer views. When a TemplatedCell2 is dequeued as a
supplementary view, its ScrollDirection property was never set — it
silently defaulted to UICollectionViewScrollDirection.Vertical. This was
an oversight, because regular item cells in GetCell() already correctly
assigned ScrollDirection. The missing assignment fed through to
GetMeasureConstraints() in TemplatedCell2, which uses ScrollDirection to
decide how to constrain the cell during measurement: for a horizontal
grid, a Vertical direction incorrectly constrains the cell's width to
the estimated value (~30pt from LayoutFactory2) instead of leaving it
unconstrained, causing header/footer labels to be clipped to a tiny
width and become inaccessible in the UI tree.

### Description of Change:

The fix is a one-line addition in each of the two affected view
controllers, mirroring the pattern already used in GetCell(). In
StructuredItemsViewController2.GetViewForSupplementaryElement(),
templatedCell.ScrollDirection = ScrollDirection is set before calling
UpdateTemplatedSupplementaryView. The same line is added in
GroupableItemsViewController2.GetViewForSupplementaryElement() for group
header/footer cells. With ScrollDirection correctly propagated,
GetMeasureConstraints() leaves the width unconstrained for horizontal
grids, allowing headers and footers to self-size to their full content
width. Vertical layouts are unaffected since they already defaulted to
Vertical, and the change has no impact on Android or Windows as Items2
is iOS/MacCatalyst-only.

**Tested the behavior in the following platforms: **

- [ ] Android
- [ ] Windows
- [x] iOS
- [x] Mac

### Reference:

N/A

### Issues Fixed:

Fixes #35113            

### Screenshots
| Before  | After  |
|---------|--------|
| <img width="400" height="500"
src="https://github.com/user-attachments/assets/319d97f0-a4b9-4b00-bc9a-670fd44fd86f"
/> | <img width="400" height="500" alt="After_31553"
src="https://github.com/user-attachments/assets/710a0fca-0c92-48fd-a91f-697d9e0d6b86"
/> |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-collectionview CollectionView, CarouselView, IndicatorView collectionview-cv2 community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/macos macOS / Mac Catalyst s/agent-approved AI agent recommends approval - PR fix is correct and optimal s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix) s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MacOS][CV2] I8_View header and footer_Horizontal_View - Footer on the right doesn't adapt when resizing the window

5 participants