Repository navigation
[inflight/candidate] [Android] Fix CollectionView selection with pointer gestures (#37952) - #39387
Merged
Merged
Conversation
…#37952) Backport the exact two-file delta from cc8e349, merged into inflight/current for #34491. Preserve native clickable-view touch ownership so CollectionView selection is not swallowed by pointer gestures. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: dac2dd94-1d58-4022-b496-1ffe726b7768
kubaflo
temporarily deployed
to
copilot-pat-pool
October 14, 2026 16:06 — with
GitHub Actions
Inactive
kubaflo
temporarily deployed
to
copilot-pat-pool
October 14, 2026 16:06 — with
GitHub Actions
Inactive
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
kubaflo
temporarily deployed
to
copilot-pat-pool
October 14, 2026 16:07 — with
GitHub Actions
Inactive
kubaflo
temporarily deployed
to
copilot-pat-pool
October 14, 2026 16:09 — with
GitHub Actions
Inactive
kubaflo
temporarily deployed
to
copilot-pat-pool
October 14, 2026 16:11 — with
GitHub Actions
Inactive
kubaflo
temporarily deployed
to
copilot-pat-pool
October 14, 2026 16:11 — with
GitHub Actions
Inactive
kubaflo
added a commit
that referenced
this pull request
Oct 18, 2026
…ter gestures (#37952) (#39387) <!-- 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! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Description of Change <!-- Enter description of the fix in this section --> Exact backport of [#37952](#37952), merged into `inflight/current` as [`cc8e3495d1e67c9e84964d80671424c4fa9fa39b`](cc8e349). **Target exception:** `inflight/candidate` is explicitly requested for this servicing backport, rather than the template's usual `main` target. Preserves the final merged fix without additional dependencies, tests, or redesign: inspect the Android native view hierarchy for a clickable view, and retain pointer touch ownership only for the initial Down event when no clickable native view owns the sequence. This prevents a PointerGestureRecognizer inside a CollectionView item template from swallowing native item selection. Only `PointerGestureHandler.cs` and `TapAndPanGestureDetector.cs` change: 19 insertions and one deletion. Candidate `e741040bbd9ed84f5ee9fadab207501e4fa0e0a2` has byte-identical pre-fix contents to the source commit's parent in both files. The backport has byte-identical post-fix contents to the merged source. Both deltas have stable patch-id `845193da6780e357ad479b85bedc5560f875f860`. Open and merged Candidate PRs were rechecked by source number, issue number, and mechanism immediately before publishing; no duplicate was found. **Local validation** Host SDK: `11.0.100-preview.6.26359.118`; the Android build targets `net10.0-android36.0`, and managed tests run on `net10.0`. | Command | Result | | --- | --- | | `dotnet build Microsoft.Maui.BuildTasks.slnf --no-restore -p:BuildTaskOnlyBuild=true -p:MauiPlatforms=net10.0-android36.0 -p:IncludePreviousTfms=false -v:minimal` | Initial attempt failed with missing dependency assets (`NETSDK1004`) and .NET Framework 4.7.2 reference assemblies (`MSB3644`); resolved by the following restore and retry. | | `dotnet restore Microsoft.Maui.BuildTasks.slnf -p:BuildTaskOnlyBuild=true -p:MauiPlatforms=net10.0-android36.0 -p:IncludePreviousTfms=false -v:minimal` | Passed. | | `dotnet build Microsoft.Maui.BuildTasks.slnf --no-restore -p:BuildTaskOnlyBuild=true -p:MauiPlatforms=net10.0-android36.0 -p:IncludePreviousTfms=false -v:quiet '-clp:ErrorsOnly;Summary'` | Passed: 3 warnings, 0 errors. | | `dotnet build src/Controls/src/Core/Controls.Core.csproj -f net10.0-android36.0 --no-restore -p:MauiPlatforms=net10.0-android36.0 -p:IncludePreviousTfms=false -v:quiet '-clp:ErrorsOnly;Summary'` | Passed: 0 warnings, 0 errors. | | `dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj -f net10.0 --filter 'FullyQualifiedName~Microsoft.Maui.Controls.Core.UnitTests.PointerGestureRecognizerTests' -p:MauiPlatforms=net10.0-android36.0 -p:IncludePreviousTfms=false -v:quiet '-clp:ErrorsOnly;Summary'` | Passed: 25 tests, 0 failed, 0 skipped. | | `dotnet format whitespace --folder --include src/Controls/src/Core/Platform/Android/PointerGestureHandler.cs src/Controls/src/Core/Platform/Android/TapAndPanGestureDetector.cs --verify-no-changes --verbosity minimal` | Passed; source formatting preserved. | | `git diff --check origin/inflight/candidate...HEAD` | Passed. | | `git diff --exit-code cc8e349 HEAD -- src/Controls/src/Core/Platform/Android/PointerGestureHandler.cs src/Controls/src/Core/Platform/Android/TapAndPanGestureDetector.cs` | Passed; exact merged-source postimages. | | `git diff cc8e349^ cc8e349 \| git patch-id --stable` and `git diff origin/inflight/candidate...HEAD \| git patch-id --stable` | Passed; identical patch-id above. | **Native validation gap:** No emulator/device or manual UI validation was performed. The focused tests cover managed recognizer behavior, not Android native touch dispatch, CollectionView selection, or SelectionChanged. No XCTest, MacCatalyst testing, or foreground/device UI automation was run. CI results have not been evaluated in this task. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #34491 via backport of [#37952](#37952). <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: dac2dd94-1d58-4022-b496-1ffe726b7768
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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!
Description of Change
Exact backport of #37952, merged into
inflight/currentascc8e3495d1e67c9e84964d80671424c4fa9fa39b.Target exception:
inflight/candidateis explicitly requested for this servicing backport, rather than the template's usualmaintarget.Preserves the final merged fix without additional dependencies, tests, or redesign: inspect the Android native view hierarchy for a clickable view, and retain pointer touch ownership only for the initial Down event when no clickable native view owns the sequence. This prevents a PointerGestureRecognizer inside a CollectionView item template from swallowing native item selection.
Only
PointerGestureHandler.csandTapAndPanGestureDetector.cschange: 19 insertions and one deletion. Candidatee741040bbd9ed84f5ee9fadab207501e4fa0e0a2has byte-identical pre-fix contents to the source commit's parent in both files. The backport has byte-identical post-fix contents to the merged source. Both deltas have stable patch-id845193da6780e357ad479b85bedc5560f875f860. Open and merged Candidate PRs were rechecked by source number, issue number, and mechanism immediately before publishing; no duplicate was found.Local validation
Host SDK:
11.0.100-preview.6.26359.118; the Android build targetsnet10.0-android36.0, and managed tests run onnet10.0.dotnet build Microsoft.Maui.BuildTasks.slnf --no-restore -p:BuildTaskOnlyBuild=true -p:MauiPlatforms=net10.0-android36.0 -p:IncludePreviousTfms=false -v:minimalNETSDK1004) and .NET Framework 4.7.2 reference assemblies (MSB3644); resolved by the following restore and retry.dotnet restore Microsoft.Maui.BuildTasks.slnf -p:BuildTaskOnlyBuild=true -p:MauiPlatforms=net10.0-android36.0 -p:IncludePreviousTfms=false -v:minimaldotnet build Microsoft.Maui.BuildTasks.slnf --no-restore -p:BuildTaskOnlyBuild=true -p:MauiPlatforms=net10.0-android36.0 -p:IncludePreviousTfms=false -v:quiet '-clp:ErrorsOnly;Summary'dotnet build src/Controls/src/Core/Controls.Core.csproj -f net10.0-android36.0 --no-restore -p:MauiPlatforms=net10.0-android36.0 -p:IncludePreviousTfms=false -v:quiet '-clp:ErrorsOnly;Summary'dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj -f net10.0 --filter 'FullyQualifiedName~Microsoft.Maui.Controls.Core.UnitTests.PointerGestureRecognizerTests' -p:MauiPlatforms=net10.0-android36.0 -p:IncludePreviousTfms=false -v:quiet '-clp:ErrorsOnly;Summary'dotnet format whitespace --folder --include src/Controls/src/Core/Platform/Android/PointerGestureHandler.cs src/Controls/src/Core/Platform/Android/TapAndPanGestureDetector.cs --verify-no-changes --verbosity minimalgit diff --check origin/inflight/candidate...HEADgit diff --exit-code cc8e3495d1e67c9e84964d80671424c4fa9fa39b HEAD -- src/Controls/src/Core/Platform/Android/PointerGestureHandler.cs src/Controls/src/Core/Platform/Android/TapAndPanGestureDetector.csgit diff cc8e3495d1e67c9e84964d80671424c4fa9fa39b^ cc8e3495d1e67c9e84964d80671424c4fa9fa39b | git patch-id --stableandgit diff origin/inflight/candidate...HEAD | git patch-id --stableNative validation gap: No emulator/device or manual UI validation was performed. The focused tests cover managed recognizer behavior, not Android native touch dispatch, CollectionView selection, or SelectionChanged. No XCTest, MacCatalyst testing, or foreground/device UI automation was run. CI results have not been evaluated in this task.
Issues Fixed
Fixes #34491 via backport of #37952.