Skip to content

Revert "[Android][NET 10] Fix: Ensure Image consumes touches properly #29363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2025

Conversation

kubaflo
Copy link
Contributor

@kubaflo kubaflo commented May 6, 2025

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

This reverts commit a71e593.

I'm not sure it is a right fix and I think it caused this regression #29349

Issues Fixed

Fixes #29349

@Copilot Copilot AI review requested due to automatic review settings May 6, 2025 22:43
@kubaflo kubaflo requested a review from a team as a code owner May 6, 2025 22:43
Copy link
Contributor

@Copilot 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

This PR reverts a previous commit that modified touch handling on Image controls for Android, addressing a regression introduced by the earlier fix. The key changes include:

  • Removing the MapInputTransparent API mapping from the public API file.
  • Reverting modifications in the Android-specific ImageHandler, including an accessibility-related property change.
  • Adjusting a test case for Android to compile conditionally.

Reviewed Changes

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

File Description
src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt Removed the MapInputTransparent API mapping to revert the previous change
src/Core/src/Handlers/Image/ImageHandler.cs Removed the mapping of InputTransparent from the handler's command mapper
src/Core/src/Handlers/Image/ImageHandler.Android.cs Removed the setting of ImportantForAccessibility on the platform view and the MapInputTransparent method
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue6262.cs Wrapped a test case with a conditional compilation flag for Android

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label May 6, 2025
Copy link
Contributor

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

@rmarinho
Copy link
Member

rmarinho commented May 7, 2025

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@rmarinho rmarinho added this to the .NET 10.0-preview4 milestone May 7, 2025
Copy link
Contributor

@bhavanesh2001 bhavanesh2001 left a comment

Choose a reason for hiding this comment

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

This should probably go, but just to note:

It's expected that Image shouldn't pass touches to the view behind it — this only fails on Android (see ImageShouldLayoutOnTopOfButton test).

From what I can tell, the original PR surfaced another issue with CollectionView's touch handling:

  • Instead of CollectionView intercepting the touch at the item level first and then letting it propagate to child views, the child views handle the touch before selection happens.
  • This causes Image (when it's not InputTransparent) to consume the tap and prevent item selection.

Just wanted to call that out in case it's helpful context for the broader issue.

@PureWeen PureWeen moved this from Todo to Ready To Review in MAUI SDK Ongoing May 7, 2025
@jsuarezruiz jsuarezruiz added platform/android area-image Image loading, sources, caching labels May 8, 2025
@github-project-automation github-project-automation bot moved this from Ready To Review to Approved in MAUI SDK Ongoing May 9, 2025
@rmarinho
Copy link
Member

rmarinho commented May 9, 2025

Tested the packages on WhatToEat and it fixes the regression

@rmarinho
Copy link
Member

rmarinho commented May 9, 2025

/backport to release/10.0.1xx-preview4

Copy link
Contributor

github-actions bot commented May 9, 2025

Started backporting to release/10.0.1xx-preview4: https://github.com/dotnet/maui/actions/runs/14927435969

@rmarinho rmarinho merged commit a50ae5d into dotnet:net10.0 May 9, 2025
120 of 128 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in MAUI SDK Ongoing May 9, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jun 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-image Image loading, sources, caching community ✨ Community Contribution platform/android
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants