CommunityToolkit / CommunityToolkit/Maui

[BUG] Using a behavior in a collectionview item no longer executes the SelectionChangedCommand event

Open
#2,616 3 comments 10 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

In a collectionview I would like to animate the selection of items. I tried with the TouchBehavior and the AnimationBehavior but it seems that by inserting it in the DataTemplate, the Behavior is executed but not the SelectionChangedCommand

### Expected Behavior

The item press should be animated and the SelectionChangedCommand executed.

### Steps To Reproduce

Execute the app
go to Tab2
Press items in the collectionview. The animation is executed but the SelectionChangedCommand is not raised

### Link to public reproduction project repository

https://github.com/acaliaro/MauiBehaviorInCollectionViewNotWorking

### Environment

```markdown
- .NET MAUI CommunityToolkit:11.2.0
- OS:ios 18.2.1
- .NET MAUI:9.0.50
```

### 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.