Skip to content

[Android] Fix SwipeViewShouldNotClose test failure regression#35012

Merged
kubaflo merged 1 commit into
dotnet:inflight/candidatefrom
HarishwaranVijayakumar:fix-issue29086/failure
Apr 17, 2026
Merged

[Android] Fix SwipeViewShouldNotClose test failure regression#35012
kubaflo merged 1 commit into
dotnet:inflight/candidatefrom
HarishwaranVijayakumar:fix-issue29086/failure

Conversation

@HarishwaranVijayakumar
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:

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:

  • 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

Before After

@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label Apr 17, 2026
@dotnet-policy-service
Copy link
Copy Markdown
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.

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Apr 17, 2026
@sheiksyedm sheiksyedm marked this pull request as ready for review April 17, 2026 13:12
@sheiksyedm sheiksyedm requested a review from kubaflo April 17, 2026 14:28
@kubaflo kubaflo merged commit a67c488 into dotnet:inflight/candidate Apr 17, 2026
7 of 36 checks passed
@github-actions github-actions Bot added this to the .NET 10 SR6 milestone 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.
-->
@PureWeen PureWeen modified the milestones: .NET 10 SR6, .NET 10 SR7 Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-testing Unit tests, device tests community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/android regressed-in-inflight/candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants