[Android] Fix SwipeViewShouldNotClose test failure regression#35012
Merged
kubaflo merged 1 commit intoApr 17, 2026
Merged
Conversation
Contributor
|
Hey there @@HarishwaranVijayakumar! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
kubaflo
approved these changes
Apr 17, 2026
Ahamed-Ali
pushed a commit
that referenced
this pull request
Apr 22, 2026
<!-- 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. !!!!!!! --> ### Issue Details: - [SwipeViewShouldNotClose]UI test (Issue29086) fails with [System.TimeoutException: Timed out waiting for no element] on Android after PR #24275 was merged. ### Root Cause: - PR #24275 added a check in [MauiSwipeView.ShouldInterceptTouch()](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html) to prevent taps on an open SwipeView from propagating to content children: - When [_isOpen] is true, [OnInterceptTouchEvent]returns true, which causes Android to steal all touch events from children — including buttons inside SwipeItemView controls. This breaks the Issue29086 scenario where buttons inside revealed swipe items (e.g., AddButton1) need to receive taps to fire their [Command]and update the AutomationId. ### Description of Change Touch event handling improvement: * Updated `ShouldInterceptTouch(MotionEvent? e)` in `MauiSwipeView.cs` to only intercept touches when the swipe view is open and the touch is within the content area, enhancing gesture accuracy. ### 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. --> - Regression introduced by PR #24275 - Resolved test case: SwipeViewShouldNotClose | Before | After | |----------|----------| | <img src="https://github.com/user-attachments/assets/4d3f99b6-00f7-4114-be7f-92a4821a9078"> | <img src="https://github.com/user-attachments/assets/8bbdc3d2-bf70-4a6f-9652-fea8601d06ab"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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!
Issue Details:
Root Cause:
PR [Android] Prevent the tap that closes an open SwipeView from being propagated to children #24275 added a check in MauiSwipeView.ShouldInterceptTouch() to prevent taps on an open SwipeView from propagating to content children:
When [_isOpen] is true, [OnInterceptTouchEvent]returns true, which causes Android to steal all touch events from children — including buttons inside SwipeItemView controls. This breaks the Issue29086 scenario where buttons inside revealed swipe items (e.g., AddButton1) need to receive taps to fire their [Command]and update the AutomationId.
Description of Change
Touch event handling improvement:
ShouldInterceptTouch(MotionEvent? e)inMauiSwipeView.csto only intercept touches when the swipe view is open and the touch is within the content area, enhancing gesture accuracy.Issues Fixed