CommunityToolkit / CommunityToolkit/Maui
[BUG] ContentView hover does not restore BackgroundColor
- 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
Applying the TouchBehavior to a ContentView (at least on Windows) - when the hover state is complete the view retains the configured HoveredBackgroundColor and does not restore the original ContentView color. I've tried on a few controls, seems to be ContentView specific so far.
### Expected Behavior
When the hover completes the original state of the view should be restored.
### Steps To Reproduce
1. Open and run the attached repro.
2. Mouse over the image at the top.
3. Mouse away from the image at the top.
Notice the result is this red background color that does not go away:

```
```
### Link to public reproduction project repository
https://github.com/DennisWelu/MctTouchBehaviorContentView
### Environment
```markdown
- .NET MAUI CommunityToolkit: 8.0.1
- OS: Windows 10 Pro 22H2
- .NET MAUI: 8.0.14
```
### Anything else?
_No response_
Contributor guide
Research direction
Start by running the linked reproduction project on Windows and reviewing the TouchBehavior handling for a ContentView. Reproduce the hover and mouse-away sequence, then trace how the background color is restored. Done means the original ContentView color returns after hovering ends without changing the behavior for other controls.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100