Repository navigation
[Android, iOS/Mac] Fix IsSwipeEnabled Not Working on CarouselView - #36428
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 36428Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 36428" |
…n view and embedded scroller symmetrically
This comment has been minimized.
This comment has been minimized.
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 1 findings
See inline comments for details.
| // one of the two does not reliably suppress bounce. Only the embedded scroller's | ||
| // ScrollEnabled is toggled; the outer CollectionView's ScrollEnabled is left untouched so | ||
| // unrelated scrolling (e.g. main-axis list scrolling) keeps working. | ||
| ApplyOuterBounceState(enabled); |
There was a problem hiding this comment.
🔍 AI-Generated Review (multi-model)
[major] CollectionView iOS/MacCatalyst — This leaves the outer UICollectionView.ScrollEnabled unchanged, but vertical CarouselView2 layouts do not use an embedded orthogonal scroller (LayoutFactory2 sets OrthogonalScrollingBehavior.None for vertical layouts), so the outer collection view is the view that handles the user drag. Concrete scenario: a vertical CarouselView with IsSwipeEnabled=false will still scroll between items because only bounce is disabled here and no embedded UIScrollView exists to receive ScrollEnabled=false. Please also disable the outer pan/scroll path for CarouselView vertical layouts while preserving the horizontal embedded-scroller behavior.
This comment has been minimized.
This comment has been minimized.
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 1 findings
See inline comments for details.
| // Bounce must be reapplied on the outer UICollectionView itself (it is a UIScrollView) as | ||
| // well as any embedded orthogonal scroller - confirmed empirically that setting it on only | ||
| // one of the two does not reliably suppress bounce. Only the embedded scroller's | ||
| // ScrollEnabled is toggled; the outer CollectionView's ScrollEnabled is left untouched so |
There was a problem hiding this comment.
🔍 AI-Generated Review (multi-model)
[major] Logic and Correctness — SetSwipeEnabled(false) never disables the outer UICollectionView.ScrollEnabled; it only applies ScrollEnabled to embedded non-UICollectionView scroll views. LayoutFactory2.CreateCarouselLayout uses OrthogonalScrollingBehavior.None for vertical CarouselView2, so vertical paging is performed by this outer collection view and remains swipeable when IsSwipeEnabled=false at initial load. Please also apply the swipe state to the outer collection view for vertical layouts while keeping the horizontal embedded-scroller path enabled.
There was a problem hiding this comment.
Pull request overview
Fixes CarouselView2.IsSwipeEnabled not being respected on iOS/MacCatalyst (embedded orthogonal UIScrollView) and Android (direct OnTouchEvent dispatch), and adds a regression UI test for issue #36267.
Changes:
- iOS/MacCatalyst: cache swipe/bounce state and reapply it during subview insertion and
LayoutSubviews()for both the outerUICollectionViewand embedded orthogonal scrollers. - Android: guard
MauiCarouselRecyclerView.OnTouchEventwithIsSwipeEnabledto prevent scroll initiation when swipe is disabled. - Tests: add HostApp repro page + NUnit/Appium regression tests for “IsSwipeEnabled=false at load time”.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue36267.cs | Adds UI regression coverage for load-time and toggled IsSwipeEnabled scenarios. |
| src/Controls/tests/TestCases.HostApp/Issues/Issue36267.cs | Adds HostApp issue page that reproduces the CV2 swipe-disabled-at-load scenario. |
| src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt | Records new public override surface (MauiCollectionView.LayoutSubviews) for MacCatalyst. |
| src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt | Records new public override surface (MauiCollectionView.LayoutSubviews) for iOS. |
| src/Controls/src/Core/Handlers/Items2/CarouselViewHandler2.iOS.cs | Routes swipe/bounce mapping through MauiCollectionView state application helpers. |
| src/Controls/src/Core/Handlers/Items/iOS/MauiCollectionView.cs | Applies swipe/bounce state to embedded orthogonal scrollers and outer collection view during layout/subview changes. |
| src/Controls/src/Core/Handlers/Items/Android/MauiCarouselRecyclerView.cs | Prevents RecyclerView gesture handling when IsSwipeEnabled is false even if OnTouchEvent is invoked directly. |
| public override string Issue => "[iOS] IsSwipeEnabled Not Working on CarouselView (CV2) when set to false at load time"; | ||
|
|
||
| [Test] |
| // Enable swipe gestures and verify swiping now works. | ||
| App.Tap("ToggleSwipeButton"); | ||
| App.ScrollRight("CarouselView", swipePercentage: 0.8); | ||
| App.WaitForElement("Item2"); |
This comment has been minimized.
This comment has been minimized.
MauiBot
left a comment
There was a problem hiding this comment.
AI Review Summary
@Dhivya-SF4094 — new AI review results are available based on this last commit:
b2a5a2a. To request a fresh review after new comments or commits, comment/review rerun.
🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix
Gate Result: ✅ PASSED
Platform: IOS · Base: main · Merge base: 0395a53b
| Test | Without Fix (expect FAIL) | With Fix (expect PASS) |
|---|---|---|
🖥️ Issue36267 Issue36267 |
✅ FAIL — 271s | ✅ PASS — 104s |
🔴 Without fix — 🖥️ Issue36267: FAIL ✅ · 271s
Determining projects to restore...
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/BindingSourceGen/Controls.BindingSourceGen.csproj (in 474 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Graphics/src/Graphics/Graphics.csproj (in 478 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Essentials/src/Essentials.csproj (in 5.48 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/Foldable/src/Controls.Foldable.csproj (in 5.72 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj (in 5.73 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/Core/Controls.Core.csproj (in 5.73 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/Xaml/Controls.Xaml.csproj (in 5.73 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/BlazorWebView/src/Maui/Microsoft.AspNetCore.Components.WebView.Maui.csproj (in 5.73 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/Core/src/Core.csproj (in 5.73 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/Core/maps/src/Maps.csproj (in 5.74 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/Maps/src/Controls.Maps.csproj (in 5.74 sec).
/Users/cloudtest/vss/_work/1/s/.dotnet/packs/Microsoft.iOS.Sdk.net10.0_26.0/26.0.11017/targets/Xamarin.Shared.Sdk.targets(309,3): warning : RuntimeIdentifier was set on the command line, and will override the value for RuntimeIdentifiers set in the project file. [/Users/cloudtest/vss/_work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-ios]
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14650591
Graphics -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Graphics/Debug/net10.0-ios26.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14650591
Essentials -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Essentials/Debug/net10.0-ios26.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14650591
Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Core/Debug/net10.0-ios26.0/Microsoft.Maui.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14650591
Maps -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Maps/Debug/net10.0-ios26.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.100-ci+azdo.14650591
Controls.Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-ios26.0/Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14650591
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14650591
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14650591
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14650591
Controls.Xaml -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-ios26.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-ios26.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
Controls.Maps -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-ios26.0/Microsoft.Maui.Controls.Maps.dll
Controls.Foldable -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-ios26.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
Controls.TestCases.HostApp -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-ios/iossimulator-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.
/Users/cloudtest/vss/_work/1/s/.dotnet/packs/Microsoft.iOS.Sdk.net10.0_26.0/26.0.11017/targets/Xamarin.Shared.Sdk.targets(309,3): warning : RuntimeIdentifier was set on the command line, and will override the value for RuntimeIdentifiers set in the project file. [/Users/cloudtest/vss/_work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-ios]
1 Warning(s)
0 Error(s)
Time Elapsed 00:02:00.20
Determining projects to restore...
Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/VisualTestUtils/VisualTestUtils.csproj (in 681 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/tests/CustomAttributes/Controls.CustomAttributes.csproj (in 691 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/BindingSourceGen/Controls.BindingSourceGen.csproj (in 683 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Graphics/src/Graphics/Graphics.csproj (in 696 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Essentials/src/Essentials.csproj (in 696 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/UITest.Core/UITest.Core.csproj (in 683 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Core/src/Core.csproj (in 730 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/Core/Controls.Core.csproj (in 770 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/UITest.NUnit/UITest.NUnit.csproj (in 1.07 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/UITest.Appium/UITest.Appium.csproj (in 1.82 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/UITest.Analyzers/UITest.Analyzers.csproj (in 2.45 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/TestUtils/src/VisualTestUtils.MagickNet/VisualTestUtils.MagickNet.csproj (in 2.28 sec).
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj (in 3.02 sec).
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14650591
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.100-ci+azdo.14650591
Essentials -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14650591
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.100-ci+azdo.14650591
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
UITest.NUnit -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.NUnit/Debug/net10.0/UITest.NUnit.dll
VisualTestUtils.MagickNet -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/VisualTestUtils.MagickNet/Debug/netstandard2.0/VisualTestUtils.MagickNet.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.iOS.Tests -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net10.0/Controls.TestCases.iOS.Tests.dll
Test run for /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net10.0/Controls.TestCases.iOS.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.
[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.iOS.Tests
[xUnit.net 00:00:00.14] Discovered: Controls.TestCases.iOS.Tests
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net10.0/Controls.TestCases.iOS.Tests.dll
NUnit3TestExecutor discovered 2 of 2 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 7/14/2026 5:19:50 AM FixtureSetup for Issue36267(iOS)
>>>>> 7/14/2026 5:19:54 AM IsSwipeEnabledCanBeEnabledAfterStartingDisabled Start
>>>>> 7/14/2026 5:20:10 AM IsSwipeEnabledCanBeEnabledAfterStartingDisabled Stop
>>>>> 7/14/2026 5:20:10 AM Log types: syslog, crashlog, performance, safariConsole, safariNetwork, server
Failed IsSwipeEnabledCanBeEnabledAfterStartingDisabled [16 s]
Error Message:
System.TimeoutException : Timed out waiting for element...
Stack Trace:
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
at Microsoft.Maui.TestCases.Tests.Issues.Issue36267.IsSwipeEnabledCanBeEnabledAfterStartingDisabled() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue36267.cs:line 42
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
>>>>> 7/14/2026 5:20:11 AM IsSwipeEnabledFalseFromStartDisablesSwipeGestures Start
>>>>> 7/14/2026 5:20:26 AM IsSwipeEnabledFalseFromStartDisablesSwipeGestures Stop
>>>>> 7/14/2026 5:20:26 AM Log types: syslog, crashlog, performance, safariConsole, safariNetwork, server
Failed IsSwipeEnabledFalseFromStartDisablesSwipeGestures [15 s]
Error Message:
System.TimeoutException : Timed out waiting for element...
Stack Trace:
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
at Microsoft.Maui.TestCases.Tests.Issues.Issue36267.IsSwipeEnabledFalseFromStartDisablesSwipeGestures() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue36267.cs:line 23
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
NUnit Adapter 4.5.0.0: Test execution complete
Results File: /Users/cloudtest/vss/_work/1/s/CustomAgentLogsTmp/UITests/TestResults/Issue36267.trx
Total tests: 2
Test Run Failed.
Failed: 2
Total time: 1.6641 Minutes
>>> TRX_RESULT_FILE: /Users/cloudtest/vss/_work/1/s/CustomAgentLogsTmp/UITests/TestResults/Issue36267.trx
🟢 With fix — 🖥️ Issue36267: PASS ✅ · 104s
Determining projects to restore...
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/BindingSourceGen/Controls.BindingSourceGen.csproj (in 366 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Graphics/src/Graphics/Graphics.csproj (in 372 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Essentials/src/Essentials.csproj (in 376 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/Core/Controls.Core.csproj (in 403 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Core/src/Core.csproj (in 414 ms).
6 of 11 projects are up-to-date for restore.
/Users/cloudtest/vss/_work/1/s/.dotnet/packs/Microsoft.iOS.Sdk.net10.0_26.0/26.0.11017/targets/Xamarin.Shared.Sdk.targets(309,3): warning : RuntimeIdentifier was set on the command line, and will override the value for RuntimeIdentifiers set in the project file. [/Users/cloudtest/vss/_work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-ios]
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14650591
Graphics -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Graphics/Debug/net10.0-ios26.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14650591
Essentials -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Essentials/Debug/net10.0-ios26.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14650591
Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Core/Debug/net10.0-ios26.0/Microsoft.Maui.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14650591
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-ios26.0/Microsoft.Maui.Maps.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14650591
Controls.Core -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-ios26.0/Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14650591
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14650591
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14650591
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14650591
Microsoft.AspNetCore.Components.WebView.Maui -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-ios26.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
Controls.Foldable -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-ios26.0/Microsoft.Maui.Controls.Foldable.dll
Controls.Maps -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-ios26.0/Microsoft.Maui.Controls.Maps.dll
Controls.Xaml -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-ios26.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
Controls.TestCases.HostApp -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-ios/iossimulator-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.
/Users/cloudtest/vss/_work/1/s/.dotnet/packs/Microsoft.iOS.Sdk.net10.0_26.0/26.0.11017/targets/Xamarin.Shared.Sdk.targets(309,3): warning : RuntimeIdentifier was set on the command line, and will override the value for RuntimeIdentifiers set in the project file. [/Users/cloudtest/vss/_work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-ios]
1 Warning(s)
0 Error(s)
Time Elapsed 00:00:46.66
Determining projects to restore...
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/BindingSourceGen/Controls.BindingSourceGen.csproj (in 341 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Essentials/src/Essentials.csproj (in 353 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Graphics/src/Graphics/Graphics.csproj (in 317 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Core/src/Core.csproj (in 369 ms).
Restored /Users/cloudtest/vss/_work/1/s/src/Controls/src/Core/Controls.Core.csproj (in 377 ms).
8 of 13 projects are up-to-date for restore.
Controls.CustomAttributes -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.CustomAttributes/Debug/net10.0/Controls.CustomAttributes.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14650591
Graphics -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Graphics/Debug/net10.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14650591
Essentials -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14650591
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.100-ci+azdo.14650591
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
UITest.Appium -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.Appium/Debug/net10.0/UITest.Appium.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.Analyzers -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/UITest.Analyzers/Debug/netstandard2.0/UITest.Analyzers.dll
Controls.TestCases.iOS.Tests -> /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net10.0/Controls.TestCases.iOS.Tests.dll
Test run for /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net10.0/Controls.TestCases.iOS.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.
[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.iOS.Tests
[xUnit.net 00:00:00.15] Discovered: Controls.TestCases.iOS.Tests
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net10.0/Controls.TestCases.iOS.Tests.dll
NUnit3TestExecutor discovered 2 of 2 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 7/14/2026 5:22:03 AM FixtureSetup for Issue36267(iOS)
>>>>> 7/14/2026 5:22:06 AM IsSwipeEnabledCanBeEnabledAfterStartingDisabled Start
>>>>> 7/14/2026 5:22:11 AM IsSwipeEnabledCanBeEnabledAfterStartingDisabled Stop
Passed IsSwipeEnabledCanBeEnabledAfterStartingDisabled [4 s]
>>>>> 7/14/2026 5:22:11 AM IsSwipeEnabledFalseFromStartDisablesSwipeGestures Start
>>>>> 7/14/2026 5:22:12 AM IsSwipeEnabledFalseFromStartDisablesSwipeGestures Stop
Passed IsSwipeEnabledFalseFromStartDisablesSwipeGestures [1 s]
NUnit Adapter 4.5.0.0: Test execution complete
Results File: /Users/cloudtest/vss/_work/1/s/CustomAgentLogsTmp/UITests/TestResults/Issue36267.trx
Test Run Successful.
Total tests: 2
Passed: 2
Total time: 26.1344 Seconds
>>> TRX_RESULT_FILE: /Users/cloudtest/vss/_work/1/s/CustomAgentLogsTmp/UITests/TestResults/Issue36267.trx
📁 Fix files reverted (5 files)
src/Controls/src/Core/Handlers/Items/Android/MauiCarouselRecyclerView.cssrc/Controls/src/Core/Handlers/Items/iOS/MauiCollectionView.cssrc/Controls/src/Core/Handlers/Items2/CarouselViewHandler2.iOS.cssrc/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txtsrc/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
📱 UI Tests — CarouselView,CollectionView
Detected UI test categories: CarouselView,CollectionView
✅ Deep UI tests — 96 passed, 0 failed across 1 category on platform-pool agent (replaces in-process counts above). The HostApp built and the tests started for 1 category (CollectionView) but produced no results — the run was interrupted (most often the per-category time budget was hit, or an emulator/Appium hang). This is usually an infrastructure flake rather than a code problem; re-run the review to try again. See the build-output.log in the drop-deep-uitests artifact.
🧪 UI Test Execution Results (deep, platform pool)
| Category | Tests | Snapshot diffs |
|---|---|---|
CarouselView |
96/99 ✓ | — |
📎 Download drop-deep-uitests artifact (TRX + snapshot diffs) |
📋 Pre-Flight — Context & Validation
Issue: #36267 - [iOS] IsSwipeEnabled Not Working on CarouselView (CV2)
PR: #36428 - [Android, iOS/Mac] Fix IsSwipeEnabled Not Working on CarouselView
Platforms Affected: iOS, MacCatalyst, Android (testing requested: iOS)
Files Changed: 5 implementation/API, 2 test
Key Findings
- The linked issue reproduces CarouselView2 on iOS ignoring
IsSwipeEnabled="False"when configured from initial load. - PR current fix caches swipe/bounce state and reapplies it to embedded iOS compositional-layout scroll views during subview insertion/layout; Android adds an
OnTouchEventguard matchingOnInterceptTouchEvent. - Prior inline review comments identify an unresolved vertical CarouselView2 gap: vertical layouts use the outer
UICollectionView, not an embedded orthogonal scroller. ghis unauthenticated in this environment, so GitHub checks/review APIs could not be used; public GitHub API/curl and local PR branch diff were used instead.
Code Review Summary
Verdict: NEEDS_CHANGES
Confidence: low
Errors: 1 | Warnings: 1 | Suggestions: 0
Key code review findings:
- ✗
src/Controls/src/Core/Handlers/Items/iOS/MauiCollectionView.cs:103-105leaves the outerUICollectionView.ScrollEnabledenabled, so vertical CarouselView2 can still scroll whenIsSwipeEnabled=falsebecauseLayoutFactory2usesOrthogonalScrollingBehavior.Nonefor vertical layouts. - ⚠
src/Controls/src/Core/Handlers/Items/iOS/MauiCollectionView.cs:58-66walks subviews on every layout pass after swipe is configured, which is a hot path.
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| PR | PR #36428 | Cache swipe/bounce state; reapply to embedded iOS scroll views on subview insertion/layout; add Android OnTouchEvent guard |
✅ PASSED (Gate) | MauiCarouselRecyclerView.cs, MauiCollectionView.cs, CarouselViewHandler2.iOS.cs, PublicAPI, UI tests |
Original PR; gate result supplied by caller |
🔬 Code Review — Deep Analysis
Code Review — PR #36428
Independent Assessment
What this changes: Adds additional CarouselView IsSwipeEnabled enforcement for Android touch handling and iOS/MacCatalyst CarouselView2 embedded scroll views, including bounce-state caching/reapplication during layout.
Inferred motivation: Ensure IsSwipeEnabled=false, especially when set before first layout, prevents user swipe navigation.
Reconciliation with PR Narrative
Author claims: PR fixes CarouselView IsSwipeEnabled on Android and iOS/Mac, including embedded compositional-layout scrollers and bounce behavior.
Agreement/disagreement: Android and horizontal iOS/Mac CarouselView2 paths appear aligned. Disagree for vertical CarouselView2: vertical layouts use the outer UICollectionView, but the PR intentionally leaves outer ScrollEnabled unchanged.
Prior Review Reconciliation
| Prior ❌ Error Finding | Source | Status | Evidence |
|---|---|---|---|
[major] vertical CarouselView2 still scrolls because outer UICollectionView.ScrollEnabled remains enabled |
MauiBot inline comments and top-level review | ❌ Unresolved | Current MauiCollectionView.cs:103-105 only reapplies bounce state to the outer collection view. LayoutFactory2.cs:390-392 uses OrthogonalScrollingBehavior.None for vertical CarouselView2, so no embedded scroller receives ScrollEnabled=false. |
Blast Radius Assessment
- Runs for all instances: Yes for CarouselView2 iOS/Mac and CarouselView Android; plain CollectionView remains mostly unaffected because
_isSwipeEnabledstays null. - Startup impact: Yes — initial-layout timing is central to this fix.
- Static/shared state: No — new state is instance-local.
CI Status
- Required-check result: undetermined;
gh pr checks --requiredexited 4 becauseghis unauthenticated. - Classification: undetermined
- Action taken: capped confidence at low; no GitHub comments/reviews posted.
Findings
❌ Error — Vertical CarouselView2 still ignores IsSwipeEnabled=false
src/Controls/src/Core/Handlers/Items/iOS/MauiCollectionView.cs:103-105 deliberately leaves the outer UICollectionView.ScrollEnabled unchanged and only applies ScrollEnabled to embedded non-UICollectionView scrollers. That works for horizontal CarouselView2, but vertical CarouselView2 uses OrthogonalScrollingBehavior.None, so the outer collection view handles dragging. A vertical CarouselView2 with IsSwipeEnabled=false can still scroll.
⚠️ Warning — Reapplying scroll state on every layout pass may be expensive
src/Controls/src/Core/Handlers/Items/iOS/MauiCollectionView.cs:58-66 walks Subviews on every LayoutSubviews once _isSwipeEnabled is set. This is a CarouselView layout hot path; consider caching/dirty-checking so unchanged state is not reapplied every layout pass.
Failure-Mode Probing
- Vertical CarouselView2 with
IsSwipeEnabled=false: outerUICollectionViewremains scroll-enabled, so user drag can still change position. - Horizontal CarouselView2 with embedded scroller added late: layout/subview reapplication should disable the embedded scroller.
- Android touch starting where intercept is bypassed: new
OnTouchEventguard returns false when swipe is disabled. - Non-carousel CollectionView:
_isSwipeEnabledremains null, so new iOS layout work is skipped.
Verdict: NEEDS_CHANGES
Confidence: low (platform handler/startup-layout code plus CI undetermined)
Summary: The Android and horizontal iOS/Mac approaches look reasonable, but a prior major finding remains valid: vertical CarouselView2 still uses the outer collection view for scrolling and is not disabled. CI could not be verified because gh is unauthenticated.
🛠️ Fix — Analysis & Comparison
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| 1 | expert try-fix | Orientation-aware outer UICollectionView.ScrollEnabled ownership for vertical CarouselView2 |
❌ FAIL | 4 files | iOS Issue36267 vertical test failed waiting for Item1; expert review found stale ScrollEnabled when switching vertical -> horizontal |
| 2 | expert try-fix | Outer PanGestureRecognizer delegate gate for vertical CarouselView2 |
❌ FAIL | 4 files | Initial compile fix required IUIGestureRecognizerDelegate; after fix, tests failed with app-running/crash symptoms, so delegate replacement was abandoned |
| 3 | expert try-fix | Restorable/reapplied outer ScrollEnabled ownership for vertical CarouselView2 |
❌ FAIL | 4 files | Horizontal Issue36267 tests passed; vertical runtime-orientation probe still moved to Position: 2 |
| 4 | expert try-fix | Toggle native PanGestureRecognizer.Enabled plus ScrollEnabled for vertical/embedded scrollers |
❌ FAIL | 4 files | Horizontal Issue36267 tests passed; vertical runtime-orientation probe still moved to Position: 2 |
| PR | PR #36428 | Cache swipe/bounce state and reapply to embedded iOS scroll views on insertion/layout; Android OnTouchEvent guard |
✅ PASSED (Gate) | 7 files | Original PR; gate result supplied by caller |
Cross-Pollination
| Model/Reviewer | Round | New Ideas? | Details |
|---|---|---|---|
| maui-expert-reviewer | 1 | Yes | Candidate 1: orientation-aware outer scroll ownership for vertical CarouselView2 |
| maui-expert-reviewer | 2 | Yes | Candidate 2: gate outer pan recognizer via delegate instead of ScrollEnabled |
| maui-expert-reviewer | 3 | Yes | Candidate 3: restore/reapply outer ScrollEnabled when vertical ownership changes |
| maui-expert-reviewer | 4 | Yes | Candidate 4: toggle PanGestureRecognizer.Enabled rather than replacing delegate |
| maui-expert-reviewer | Final | No | Recommended exhaustion; candidate 4 is not better than PR, and vertical orthogonal layout rewrite is too invasive |
Exhausted: Yes
Selected Fix: PR's fix — It is the only approach with the supplied passing gate. None of the explored alternatives passed the targeted iOS Issue36267 run or proved better than the PR fix.
Environment Notes
ghis unauthenticated in this environment, so CI checks and private review APIs were unavailable.EstablishBrokenBaseline.ps1could not run because the worktree had unrelated dirty.github/and skill files before this task began. The alternatives were therefore tested on the local PR review branch rather than a script-restored broken baseline.- No
gate/content.mdwas created or overwritten.
📝 Recommended PR Title & Description
Assessment: ✏️ Recommend updating — the current description is strong overall, but one iOS bullet incorrectly says ScrollEnabled is applied to the outer UICollectionView; the implementation only applies outer bounce state and toggles ScrollEnabled on embedded orthogonal UIScrollView instances.
Recommended title
[Android, iOS/Mac] CarouselView: Fix IsSwipeEnabled handling
Recommended description
### Issue Detail
CarouselView2 does not respect the IsSwipeEnabled setting.
### Root Cause
**iOS:**
- CarouselView2 uses UICollectionViewCompositionalLayout with OrthogonalScrollingBehavior, which internally creates a private embedded UIScrollView that handles paging and swipe gestures. Disabling UICollectionView.ScrollEnabled does not affect this internal scroller. The previous fix (PR #29996) only reapplied the swipe state when the embedded scroller was added through AddSubview, leaving two scenarios uncovered: the scroller could already exist before the IsSwipeEnabled mapper executed during initial layout, or UIKit could add it through other insertion APIs such as InsertSubview or InsertSubviewBelow.
- Additionally, disabling scrolling (ScrollEnabled = false) does not disable rubber-band (bounce) behavior because bouncing is controlled by the independent Bounces and AlwaysBounce properties. The embedded scroller also ignored the existing IsBounceEnabled property and instead tied its bounce behavior directly to the swipe state, causing inconsistent behavior between the outer collection view and the internal scroller.
**Android:**
MauiCarouselRecyclerView already prevented gesture interception when IsSwipeEnabled was false by overriding OnInterceptTouchEvent. However, Android's touch dispatch can invoke OnTouchEvent directly when a child view does not consume the initial `ACTION_DOWN` event (for example, when the touch begins on an empty area of the carousel). Since OnTouchEvent did not check IsSwipeEnabled, the RecyclerView could still process the gesture and scroll.
### Description of Change
**iOS:**
- Cache the current swipe and bounce state and reapply it whenever subviews are added.
- Override LayoutSubviews() to reapply the cached state on every layout pass, ensuring the embedded orthogonal scroller is updated regardless of when or how it is created.
- Apply ScrollEnabled to embedded orthogonal `UIScrollView` instances, and apply Bounces, AlwaysBounceHorizontal, and AlwaysBounceVertical consistently to both the outer UICollectionView and embedded orthogonal `UIScrollView` instances.
- Update the embedded scroller to honor the existing IsBounceEnabled property independently of IsSwipeEnabled, matching the bounce behavior of the outer collection view.
**Android:**
- Added an IsSwipeEnabled check to OnTouchEvent, matching the existing guard in OnInterceptTouchEvent, so direct touch dispatch can no longer initiate scrolling when swipe is disabled.
### Validated the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [x] iOS
- [x] Mac
### Issues Fixed:
Fixes #36267
### Screenshots
| Before | After |
|---------|--------|
| <video src="https://github.com/user-attachments/assets/2b0e8ecb-da19-4b6c-94f6-f56bbf36ae02"> | <video src="https://github.com/user-attachments/assets/3c23a0b2-d7f9-4962-b7b3-2aa72ce10752"> |
🏁 Report — Final Recommendation
Comparative Report — PR #36428
Candidates compared
| Rank | Candidate | Regression result | Assessment |
|---|---|---|---|
| 1 | pr |
✅ PASS | The submitted PR is the only candidate with the supplied passing gate: Issue36267 tests fail without the fix and pass with the fix on iOS. The Android touch-dispatch guard and iOS/MacCatalyst embedded-scroll-view reapplication are targeted and match the bug evidence. |
| 1 | pr-plus-reviewer |
✅ PASS | The expert reviewer produced no actionable inline findings and no patch, so this candidate is equivalent to pr. It does not improve on the submitted PR, but it also does not introduce risk. |
| 3 | try-fix-1 |
❌ FAIL | Orientation-aware outer UICollectionView.ScrollEnabled ownership attempted to cover vertical CarouselView2, but failed the Issue36267 run and had a stale native-state bug when switching vertical back to horizontal while swipe remained disabled. |
| 4 | try-fix-3 |
❌ FAIL | Restorable outer ScrollEnabled ownership fixed part of try-fix-1's lifecycle problem, but still failed the vertical runtime-orientation probe: PositionLabel moved to Position: 2. |
| 5 | try-fix-4 |
❌ FAIL | Toggling native PanGestureRecognizer.Enabled avoided delegate replacement risk, but still failed the same vertical runtime-orientation probe and was not demonstrably better than the PR. |
| 6 | try-fix-2 |
❌ FAIL | Replacing/gating the outer pan recognizer delegate was fragile: after an initial compile fix, the run failed with app-running/crash symptoms. This is the riskiest failed candidate. |
Key comparison points
- Candidates that failed regression tests are ranked below candidates that passed them.
- The raw PR fix has direct empirical support from the supplied gate result.
pr-plus-reviewerdoes not differ fromprbecause the expert reviewer wrote[]inline findings and recommended no code changes.- The STEP 5a alternatives all explored the prior vertical CarouselView2 concern, but none produced a passing, safe replacement. The best of those alternatives still failed runtime probes, so they cannot outrank the PR.
Winning candidate
Winner: pr
The PR is the single winning candidate because it is the only non-failed implementation with a real passing gate and no additional expert-review patch was available. The pr-plus-reviewer candidate is equivalent to the PR, so selecting the raw PR avoids implying a nonexistent reviewer-applied code delta.
🧭 Next Steps — review latest findings
No alternative fix was selected for this run. Review the session findings and CI results before merging.
…6428) <!-- 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 Detail CarouselView2 does not respect the IsSwipeEnabled setting. ### Root Cause **iOS:** - CarouselView2 uses UICollectionViewCompositionalLayout with OrthogonalScrollingBehavior, which internally creates a private embedded UIScrollView that handles paging and swipe gestures. Disabling UICollectionView.ScrollEnabled does not affect this internal scroller. The previous fix (PR #29996) only reapplied the swipe state when the embedded scroller was added through AddSubview, leaving two scenarios uncovered: the scroller could already exist before the IsSwipeEnabled mapper executed during initial layout, or UIKit could add it through other insertion APIs such as InsertSubview or InsertSubviewBelow. - Additionally, disabling scrolling (ScrollEnabled = false) does not disable rubber-band (bounce) behavior because bouncing is controlled by the independent Bounces and AlwaysBounce properties. The embedded scroller also ignored the existing IsBounceEnabled property and instead tied its bounce behavior directly to the swipe state, causing inconsistent behavior between the outer collection view and the internal scroller. **Android:** MauiCarouselRecyclerView already prevented gesture interception when IsSwipeEnabled was false by overriding OnInterceptTouchEvent. However, Android's touch dispatch can invoke OnTouchEvent directly when a child view does not consume the initial `ACTION_DOWN` event (for example, when the touch begins on an empty area of the carousel). Since OnTouchEvent did not check IsSwipeEnabled, the RecyclerView could still process the gesture and scroll. ### Description of Change **iOS:** - Cache the current swipe and bounce state and reapply it whenever subviews are added. - Override LayoutSubviews() to reapply the cached state on every layout pass, ensuring the embedded orthogonal scroller is updated regardless of when or how it is created. - Apply ScrollEnabled, Bounces, AlwaysBounceHorizontal, and AlwaysBounceVertical consistently to both the outer UICollectionView and the embedded orthogonal `UIScrollView`. - Update the embedded scroller to honor the existing IsBounceEnabled property independently of IsSwipeEnabled, matching the behavior of the outer collection view. **Android:** - Added an IsSwipeEnabled check to OnTouchEvent, matching the existing guard in OnInterceptTouchEvent, so direct touch dispatch can no longer initiate scrolling when swipe is disabled. ### Validated the behaviour in the following platforms - [x] Android - [ ] Windows - [x] iOS - [x] Mac ### Issues Fixed: Fixes #36267 ### Screenshots | Before | After | |---------|--------| | <video src="https://github.com/user-attachments/assets/2b0e8ecb-da19-4b6c-94f6-f56bbf36ae02"> | <video src="https://github.com/user-attachments/assets/3c23a0b2-d7f9-4962-b7b3-2aa72ce10752"> | --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
Performance analysisVerdict: 🟡 Advisory regression — deliberate MacCatalyst correctness cost Android, iOS, and MacCatalyst produced complete, provenance-validated evidence against the PR’s merge-time base.
Tradeoff assessment
Performance recommendations
Possible workaroundStatus: No workaround was validated. Accessibility is Recommended next actionAction: The iOS path is neutral. For MacCatalyst, measure both the current forced-reset scenario and a steady-state layout scenario before deciding whether the +139.1% relative increase needs optimization; the absolute measured cost is approximately 0.104 ms per forced layout. Coverage
📊 Managed benchmark deltasNone. The changed native CarouselView handler paths require device execution. 📱 Required device scenarios
Android environment: API 35 emulator ( 🔎 Static hot-path reviewAndroid adds a constant-time early return before loop-centering and native touch dispatch. Apple now calls
|
…6428) <!-- 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 Detail CarouselView2 does not respect the IsSwipeEnabled setting. ### Root Cause **iOS:** - CarouselView2 uses UICollectionViewCompositionalLayout with OrthogonalScrollingBehavior, which internally creates a private embedded UIScrollView that handles paging and swipe gestures. Disabling UICollectionView.ScrollEnabled does not affect this internal scroller. The previous fix (PR #29996) only reapplied the swipe state when the embedded scroller was added through AddSubview, leaving two scenarios uncovered: the scroller could already exist before the IsSwipeEnabled mapper executed during initial layout, or UIKit could add it through other insertion APIs such as InsertSubview or InsertSubviewBelow. - Additionally, disabling scrolling (ScrollEnabled = false) does not disable rubber-band (bounce) behavior because bouncing is controlled by the independent Bounces and AlwaysBounce properties. The embedded scroller also ignored the existing IsBounceEnabled property and instead tied its bounce behavior directly to the swipe state, causing inconsistent behavior between the outer collection view and the internal scroller. **Android:** MauiCarouselRecyclerView already prevented gesture interception when IsSwipeEnabled was false by overriding OnInterceptTouchEvent. However, Android's touch dispatch can invoke OnTouchEvent directly when a child view does not consume the initial `ACTION_DOWN` event (for example, when the touch begins on an empty area of the carousel). Since OnTouchEvent did not check IsSwipeEnabled, the RecyclerView could still process the gesture and scroll. ### Description of Change **iOS:** - Cache the current swipe and bounce state and reapply it whenever subviews are added. - Override LayoutSubviews() to reapply the cached state on every layout pass, ensuring the embedded orthogonal scroller is updated regardless of when or how it is created. - Apply ScrollEnabled, Bounces, AlwaysBounceHorizontal, and AlwaysBounceVertical consistently to both the outer UICollectionView and the embedded orthogonal `UIScrollView`. - Update the embedded scroller to honor the existing IsBounceEnabled property independently of IsSwipeEnabled, matching the behavior of the outer collection view. **Android:** - Added an IsSwipeEnabled check to OnTouchEvent, matching the existing guard in OnInterceptTouchEvent, so direct touch dispatch can no longer initiate scrolling when swipe is disabled. ### Validated the behaviour in the following platforms - [x] Android - [ ] Windows - [x] iOS - [x] Mac ### Issues Fixed: Fixes #36267 ### Screenshots | Before | After | |---------|--------| | <video src="https://github.com/user-attachments/assets/2b0e8ecb-da19-4b6c-94f6-f56bbf36ae02"> | <video src="https://github.com/user-attachments/assets/3c23a0b2-d7f9-4962-b7b3-2aa72ce10752"> | --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
…6428) <!-- 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 Detail CarouselView2 does not respect the IsSwipeEnabled setting. ### Root Cause **iOS:** - CarouselView2 uses UICollectionViewCompositionalLayout with OrthogonalScrollingBehavior, which internally creates a private embedded UIScrollView that handles paging and swipe gestures. Disabling UICollectionView.ScrollEnabled does not affect this internal scroller. The previous fix (PR #29996) only reapplied the swipe state when the embedded scroller was added through AddSubview, leaving two scenarios uncovered: the scroller could already exist before the IsSwipeEnabled mapper executed during initial layout, or UIKit could add it through other insertion APIs such as InsertSubview or InsertSubviewBelow. - Additionally, disabling scrolling (ScrollEnabled = false) does not disable rubber-band (bounce) behavior because bouncing is controlled by the independent Bounces and AlwaysBounce properties. The embedded scroller also ignored the existing IsBounceEnabled property and instead tied its bounce behavior directly to the swipe state, causing inconsistent behavior between the outer collection view and the internal scroller. **Android:** MauiCarouselRecyclerView already prevented gesture interception when IsSwipeEnabled was false by overriding OnInterceptTouchEvent. However, Android's touch dispatch can invoke OnTouchEvent directly when a child view does not consume the initial `ACTION_DOWN` event (for example, when the touch begins on an empty area of the carousel). Since OnTouchEvent did not check IsSwipeEnabled, the RecyclerView could still process the gesture and scroll. ### Description of Change **iOS:** - Cache the current swipe and bounce state and reapply it whenever subviews are added. - Override LayoutSubviews() to reapply the cached state on every layout pass, ensuring the embedded orthogonal scroller is updated regardless of when or how it is created. - Apply ScrollEnabled, Bounces, AlwaysBounceHorizontal, and AlwaysBounceVertical consistently to both the outer UICollectionView and the embedded orthogonal `UIScrollView`. - Update the embedded scroller to honor the existing IsBounceEnabled property independently of IsSwipeEnabled, matching the behavior of the outer collection view. **Android:** - Added an IsSwipeEnabled check to OnTouchEvent, matching the existing guard in OnInterceptTouchEvent, so direct touch dispatch can no longer initiate scrolling when swipe is disabled. ### Validated the behaviour in the following platforms - [x] Android - [ ] Windows - [x] iOS - [x] Mac ### Issues Fixed: Fixes #36267 ### Screenshots | Before | After | |---------|--------| | <video src="https://github.com/user-attachments/assets/2b0e8ecb-da19-4b6c-94f6-f56bbf36ae02"> | <video src="https://github.com/user-attachments/assets/3c23a0b2-d7f9-4962-b7b3-2aa72ce10752"> | --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
…6428) <!-- 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 Detail CarouselView2 does not respect the IsSwipeEnabled setting. ### Root Cause **iOS:** - CarouselView2 uses UICollectionViewCompositionalLayout with OrthogonalScrollingBehavior, which internally creates a private embedded UIScrollView that handles paging and swipe gestures. Disabling UICollectionView.ScrollEnabled does not affect this internal scroller. The previous fix (PR #29996) only reapplied the swipe state when the embedded scroller was added through AddSubview, leaving two scenarios uncovered: the scroller could already exist before the IsSwipeEnabled mapper executed during initial layout, or UIKit could add it through other insertion APIs such as InsertSubview or InsertSubviewBelow. - Additionally, disabling scrolling (ScrollEnabled = false) does not disable rubber-band (bounce) behavior because bouncing is controlled by the independent Bounces and AlwaysBounce properties. The embedded scroller also ignored the existing IsBounceEnabled property and instead tied its bounce behavior directly to the swipe state, causing inconsistent behavior between the outer collection view and the internal scroller. **Android:** MauiCarouselRecyclerView already prevented gesture interception when IsSwipeEnabled was false by overriding OnInterceptTouchEvent. However, Android's touch dispatch can invoke OnTouchEvent directly when a child view does not consume the initial `ACTION_DOWN` event (for example, when the touch begins on an empty area of the carousel). Since OnTouchEvent did not check IsSwipeEnabled, the RecyclerView could still process the gesture and scroll. ### Description of Change **iOS:** - Cache the current swipe and bounce state and reapply it whenever subviews are added. - Override LayoutSubviews() to reapply the cached state on every layout pass, ensuring the embedded orthogonal scroller is updated regardless of when or how it is created. - Apply ScrollEnabled, Bounces, AlwaysBounceHorizontal, and AlwaysBounceVertical consistently to both the outer UICollectionView and the embedded orthogonal `UIScrollView`. - Update the embedded scroller to honor the existing IsBounceEnabled property independently of IsSwipeEnabled, matching the behavior of the outer collection view. **Android:** - Added an IsSwipeEnabled check to OnTouchEvent, matching the existing guard in OnInterceptTouchEvent, so direct touch dispatch can no longer initiate scrolling when swipe is disabled. ### Validated the behaviour in the following platforms - [x] Android - [ ] Windows - [x] iOS - [x] Mac ### Issues Fixed: Fixes #36267 ### Screenshots | Before | After | |---------|--------| | <video src="https://github.com/user-attachments/assets/2b0e8ecb-da19-4b6c-94f6-f56bbf36ae02"> | <video src="https://github.com/user-attachments/assets/3c23a0b2-d7f9-4962-b7b3-2aa72ce10752"> | --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
…6428) <!-- 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 Detail CarouselView2 does not respect the IsSwipeEnabled setting. ### Root Cause **iOS:** - CarouselView2 uses UICollectionViewCompositionalLayout with OrthogonalScrollingBehavior, which internally creates a private embedded UIScrollView that handles paging and swipe gestures. Disabling UICollectionView.ScrollEnabled does not affect this internal scroller. The previous fix (PR #29996) only reapplied the swipe state when the embedded scroller was added through AddSubview, leaving two scenarios uncovered: the scroller could already exist before the IsSwipeEnabled mapper executed during initial layout, or UIKit could add it through other insertion APIs such as InsertSubview or InsertSubviewBelow. - Additionally, disabling scrolling (ScrollEnabled = false) does not disable rubber-band (bounce) behavior because bouncing is controlled by the independent Bounces and AlwaysBounce properties. The embedded scroller also ignored the existing IsBounceEnabled property and instead tied its bounce behavior directly to the swipe state, causing inconsistent behavior between the outer collection view and the internal scroller. **Android:** MauiCarouselRecyclerView already prevented gesture interception when IsSwipeEnabled was false by overriding OnInterceptTouchEvent. However, Android's touch dispatch can invoke OnTouchEvent directly when a child view does not consume the initial `ACTION_DOWN` event (for example, when the touch begins on an empty area of the carousel). Since OnTouchEvent did not check IsSwipeEnabled, the RecyclerView could still process the gesture and scroll. ### Description of Change **iOS:** - Cache the current swipe and bounce state and reapply it whenever subviews are added. - Override LayoutSubviews() to reapply the cached state on every layout pass, ensuring the embedded orthogonal scroller is updated regardless of when or how it is created. - Apply ScrollEnabled, Bounces, AlwaysBounceHorizontal, and AlwaysBounceVertical consistently to both the outer UICollectionView and the embedded orthogonal `UIScrollView`. - Update the embedded scroller to honor the existing IsBounceEnabled property independently of IsSwipeEnabled, matching the behavior of the outer collection view. **Android:** - Added an IsSwipeEnabled check to OnTouchEvent, matching the existing guard in OnInterceptTouchEvent, so direct touch dispatch can no longer initiate scrolling when swipe is disabled. ### Validated the behaviour in the following platforms - [x] Android - [ ] Windows - [x] iOS - [x] Mac ### Issues Fixed: Fixes #36267 ### Screenshots | Before | After | |---------|--------| | <video src="https://github.com/user-attachments/assets/2b0e8ecb-da19-4b6c-94f6-f56bbf36ae02"> | <video src="https://github.com/user-attachments/assets/3c23a0b2-d7f9-4962-b7b3-2aa72ce10752"> | --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
…6428) <!-- 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 Detail CarouselView2 does not respect the IsSwipeEnabled setting. ### Root Cause **iOS:** - CarouselView2 uses UICollectionViewCompositionalLayout with OrthogonalScrollingBehavior, which internally creates a private embedded UIScrollView that handles paging and swipe gestures. Disabling UICollectionView.ScrollEnabled does not affect this internal scroller. The previous fix (PR #29996) only reapplied the swipe state when the embedded scroller was added through AddSubview, leaving two scenarios uncovered: the scroller could already exist before the IsSwipeEnabled mapper executed during initial layout, or UIKit could add it through other insertion APIs such as InsertSubview or InsertSubviewBelow. - Additionally, disabling scrolling (ScrollEnabled = false) does not disable rubber-band (bounce) behavior because bouncing is controlled by the independent Bounces and AlwaysBounce properties. The embedded scroller also ignored the existing IsBounceEnabled property and instead tied its bounce behavior directly to the swipe state, causing inconsistent behavior between the outer collection view and the internal scroller. **Android:** MauiCarouselRecyclerView already prevented gesture interception when IsSwipeEnabled was false by overriding OnInterceptTouchEvent. However, Android's touch dispatch can invoke OnTouchEvent directly when a child view does not consume the initial `ACTION_DOWN` event (for example, when the touch begins on an empty area of the carousel). Since OnTouchEvent did not check IsSwipeEnabled, the RecyclerView could still process the gesture and scroll. ### Description of Change **iOS:** - Cache the current swipe and bounce state and reapply it whenever subviews are added. - Override LayoutSubviews() to reapply the cached state on every layout pass, ensuring the embedded orthogonal scroller is updated regardless of when or how it is created. - Apply ScrollEnabled, Bounces, AlwaysBounceHorizontal, and AlwaysBounceVertical consistently to both the outer UICollectionView and the embedded orthogonal `UIScrollView`. - Update the embedded scroller to honor the existing IsBounceEnabled property independently of IsSwipeEnabled, matching the behavior of the outer collection view. **Android:** - Added an IsSwipeEnabled check to OnTouchEvent, matching the existing guard in OnInterceptTouchEvent, so direct touch dispatch can no longer initiate scrolling when swipe is disabled. ### Validated the behaviour in the following platforms - [x] Android - [ ] Windows - [x] iOS - [x] Mac ### Issues Fixed: Fixes #36267 ### Screenshots | Before | After | |---------|--------| | <video src="https://github.com/user-attachments/assets/2b0e8ecb-da19-4b6c-94f6-f56bbf36ae02"> | <video src="https://github.com/user-attachments/assets/3c23a0b2-d7f9-4962-b7b3-2aa72ce10752"> | --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
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 Detail
CarouselView2 does not respect the IsSwipeEnabled setting.
Root Cause
iOS:
CarouselView2 uses UICollectionViewCompositionalLayout with OrthogonalScrollingBehavior, which internally creates a private embedded UIScrollView that handles paging and swipe gestures. Disabling UICollectionView.ScrollEnabled does not affect this internal scroller. The previous fix (PR [iOS] Support for IsSwipeEnabled on CarouselView2 #29996) only reapplied the swipe state when the embedded scroller was added through AddSubview, leaving two scenarios uncovered: the scroller could already exist before the IsSwipeEnabled mapper executed during initial layout, or UIKit could add it through other insertion APIs such as InsertSubview or InsertSubviewBelow.
Additionally, disabling scrolling (ScrollEnabled = false) does not disable rubber-band (bounce) behavior because bouncing is controlled by the independent Bounces and AlwaysBounce properties. The embedded scroller also ignored the existing IsBounceEnabled property and instead tied its bounce behavior directly to the swipe state, causing inconsistent behavior between the outer collection view and the internal scroller.
Android:
MauiCarouselRecyclerView already prevented gesture interception when IsSwipeEnabled was false by overriding OnInterceptTouchEvent. However, Android's touch dispatch can invoke OnTouchEvent directly when a child view does not consume the initial
ACTION_DOWNevent (for example, when the touch begins on an empty area of the carousel). Since OnTouchEvent did not check IsSwipeEnabled, the RecyclerView could still process the gesture and scroll.Description of Change
iOS:
UIScrollView.Android:
Validated the behaviour in the following platforms
Issues Fixed:
Fixes #36267
Screenshots
36267_Beforefix_iOS.mov
36267_AfterFix_iOS.mov