Maui: [BUG][Regression][8.0.1] TouchBevavior binding not working in a CollectionView
Is there an existing issue for this?
- I have searched the existing issues
Did you read the “Reporting a bug” section on Contributing file?
- 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
TouchBehavior binding is not working in a CollectionView when using 8.0.1. It seems like the wrong item is binded after the CollectionView is scrolled a bit (recycling issue?). This is a regression in 8.0.1. No issue in 8.0.0.
I mentionned this issue in the PR but so far nobody has reacted. https://github.com/CommunityToolkit/Maui/pull/1791#issuecomment-2039825987
Expected Behavior
I expect it to work the same as in 8.0.0.
Steps To Reproduce
- Open and run solution from repro.
- Tap on any item. Scroll the CollectionView. Tap again any item.
- At some point (probably after recycling of views), the alert shows that the TouchBehavior binds to the wrong item.
Link to public reproduction project repository
https://github.com/tranb3r/Issues/tree/main/MauiAppMct801TouchBehavior
Environment
- .NET MAUI CommunityToolkit:8.0.1
- OS:Android
- .NET MAUI:8.0.14
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (5 by maintainers)
Sure, but this only works for a simple Tap, not for other gestures like LongPress, which is the reason why we’re using TouchBehavior.
We plan on fixing this with a breaking change when we do a major-version bump to .NET 9
Yes, we have a breaking change in our .NET 9 release where we will no longer automatically assign the BindingContext for any
CommunityToolkit.Maui.Behavior.