Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TouchEffect inside CollectionView DataTemplate not letting select item on Android

See original GitHub issue

Placing TouchEffect inside the DataTemplate of a CollectionView (I have tried Frame & Grid) does not work on Android.

I have tried by calling SelectionChangedCommand and doesn’t work either. I have tested on iOS and UWP and it works.

Repro link:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

AndreiMisiukevichcommented, Sep 26, 2020

I’ve done some tests and I don’t see any issue without handling it. The e.Handled should be set to False, the default value is True.

I think the behavior should be the same on different platforms, the event should be handled on all or none. Currently is handled on Android but not on iOS or UWP.

I often define TouchEffect in a global Style, that’s why I use GestureRecognizer in the element. It works well, TouchEffect provides visual states and the gestures execute the commands.

Well, if it works well even in the ScrollView sample, then I will appreciate submitting a PR with the fix 😃 Would you like to do it?

YZahringercommented, Sep 24, 2020

I think it’s not specific to CollectionView, TapGestureRecognizer does not work on any element with TouchEffect on Android

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Bug] TouchEffect.NativeAnimation="True" will deselect ...
I have collection view that is stack layout with frames that have images in them. When I click on one that is already...
Read more >
Button is not clickable in CollectionView
Now in ContentPage , declare a List<Car> to store only one item to keep this collection view is single selected. And use MessagingCenter...
Read more >
LongPress, Animations and More with TouchEffects in ...
With the TouchEffects in Xamarin Community Toolkit it has never been easier to add a LongPress to any visual element.
Read more >
SelectedItem not Firing - Microsoft Q&A
Hello I am using a collectionView, but the item is not firing in the VM vm private ObservableCollection<Result> _pokeItems; ...
Read more >
Binding in C# from within DataTemplate to parent ...
The statement which does not work due to missing BindingContext within the DataTemplate is the TouchEffect.SetLongPressCommand one.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found