CommunityToolkit / CommunityToolkit/Maui
[BUG] [Android] Touch Effect registers 2 clicks in 1 on ImageButton.
- 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
Image button registers a click event twice after utilizing touch behavior.
### Expected Behavior
Expected regular click event registers once.
### Steps To Reproduce
On the sample project:
The first ImageButton, without touch behavior, functions normally, but the second ImageButton, with touch behavior, behaves anomalously.
### Link to public reproduction project repository
https://github.com/BySuspect/TouchBugSample
### Environment
```markdown
- .NET MAUI CommunityToolkit: 8.0.1
- OS: Windows 11 Build 226331.35.27
- .NET MAUI: 8.x (im not sure)
```
### Anything else?
Also, it's the same for `ImageTouchBehavior` and `TouchBehavior`. I've only tested it on Android, so I'm not sure if it's the same on other platforms.
Sample video: https://youtu.be/puBzXjbIg0o
Contributor guide
Research direction
Start with the linked TouchBugSample reproduction and run it on Android, comparing the ImageButton without touch behavior to those using TouchBehavior and ImageTouchBehavior. Trace the corresponding touch and click handling in the toolkit, then verify that each ImageButton activation raises exactly one click event.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, csharp
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100