CommunityToolkit / CommunityToolkit/Maui

[BUG] TouchBehavior overrides BackgroundColor binding and prevents UI updates

Open
#3,091 3 comments 0 reactions 0 assignees View on GitHub
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

When using TouchBehavior on a Border, the behavior overrides the BackgroundColor even when the property is bound to a dynamic value. This causes the UI to stop updating the color in real time.
The issue appears when using HoveredBackgroundColor, but also happens indirectly when using other hover properties (scale, rotation, etc.), because the behavior internally manipulates the visual state and blocks the bound color from refreshing.
This results in:
- The bound color not updating while the pointer is over the control
- The UI showing an incorrect color
- The correct color only appearing after restarting the app
- The binding not receiving updates until the hover state ends
This makes Touch Behavior incompatible with dynamic color scenarios.

### Expected Behavior

The BackgroundColor binding should continue to update normally, even when TouchBehavior is active.

### Steps To Reproduce

- Create a ContentView with a Border whose BackgroundColor is bound to a ViewModel property.
- Add a TouchBehavior to the same Border.
- Change the bound color at runtime (e.g., via a ColorPicker).
- Observe that the UI does not update the color until the pointer leaves the control or the app restarts.

### Link to public reproduction project repository

https://github.com/eduardoagr/TextileSystem

### Environment

```markdown
- .NET MAUI version: 10
- CommunityToolkit.Maui version: 14
- Platform: Windows / Android / iOS
```

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.