CommunityToolkit / CommunityToolkit/Maui

[BUG] [Android] TouchBehavior broken when applied to a control template

Open
#1,830 0 comments 1 reaction 0 assignees View on GitHub
area/behaviors bug unverified
Dominant language
C#
Stars
2.7k
Forks
500
Avg merge
2d 14h
Merged PRs (30d)
7

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Did you read the "Reporting a bug" section on Contributing file?

- [X] I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug

### Current Behavior

Touch Behavior added as a behavior to a control template does not work on Android, but does work on iOS.

### Expected Behavior

Touch behavior added as a behavior to a control template works on Android and iOS.

### Steps To Reproduce

Open and run the solution on Android.
Press the "Tap Me" box and observe there is no animation.

### Link to public reproduction project repository

https://github.com/Hackmodford/maui-android-control-template-touch-behavior-bug

### Environment

```markdown
- .NET MAUI CommunityToolkit: 8.0.1
- OS: macOS Sonoma 14.4.1
- .NET MAUI: 8.0.200
```

### Anything else?

In the example I would expect the gray box to animate its scale and bounce back when released. But it is not working on Android. In my actual app the command binding is also not working.

Contributor guide

Open the contributing guide

Research direction

Start with the public reproduction project linked in the issue and run the solution on Android. Inspect how TouchBehavior is applied to the control template; done means the gray box animates on press and release and the command binding works on Android as it does on iOS.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, csharp
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.