-
Notifications
You must be signed in to change notification settings - Fork 471
[Bug] iOS Touch Effects cause weird behavior with multiple selection enabled in CollectionView items #1157
Comments
Update: |
Ok. So I've isolated the problem a little too much. The stuff I was complaining about was fixed via meJevin/TouchEffectBug@a098a5a However. There is one more issue. When changing selection mode of the CollectionView with my custom ItemTemplate. Multiple selection is behaving weird on iOS. I've updated the repo. Check it out. Steps to reproduce
Step 9 is really weird. Sometimes the items will be selected again, sometimes not. Sometimes you need to click them multiple times to select. Sometimes you need to select some of the items you've not touched in order to be able to select item 0,1,2,3. Really weird This is the real issue I have. Really waiting for your help guys. |
Screen.Recording.2021-04-01.at.15.56.40.mp4 |
Note: this doesn't happen on Android. |
@meJevin hello. |
@AndreiMisiukevich, removed everything related to TouchEffect in my code. Issue is not present anymore. Check out this branch of my repo for yourself https://github.com/meJevin/TouchEffectBug/tree/no-touch-effect (I commented out the parts in |
So I'm pretty positive that this issue has something to do with TouchEffect. Maybe the way it intercepts OnTouchBegin on iOS or however it's implemented.. I think I saw an issue about this and people were discussing something along those lines. |
Ну и вообще да.... на андроиде то работает елы палы |
Then just remove the touch effect when it's not needed.
|
That's almost exactly what I'm doing in my code. No luck though. Multi selection is still broken. |
Спасибо, Миша) Филл фри кидать PR если знаешь, как пофиксить Thanks Michael, feel free to submit PR if you know how to fix it) |
I'll try to dig my way in and figure this out, if I can. But multi selection is actually broken in a really peculiar way too.. When I remove the effect, I am able to select (or deselect if its already selected) an item once, but no further interaction is possible with it afterwards, the item seems to ignore the clicks somehow. |
We believe this might be fixed in https://github.com/xamarin/XamarinCommunityToolkit/releases/tag/2.0.6 If not, please let uw know, open a new issue and link this one. Thanks! |
Description
In my project I have the following scenario: I have a CollectionView with a custom ItemTemplate. My custom ItemTemplate has TouchEffects applied on it. There is an option to disable those touch effects via a binding. I create a BindableProperty for my custom ItemTemplate and set a binding on it which can be controlled from outside. When that property changes I remove/add the TouchEffects.
Everything is OK on Android. But on iOS the LongPressCommand doesn't seem to go away for some reason.
I've isolated the problem into a separate project and put it into a github repo, so you guys could inspect it better.
https://github.com/meJevin/TouchEffectBug
Please pay attention to
Controls/TestTemplate.xaml
and its code-behind file. This is my custom template. In code behind I have a bindable property, which, when changes, adds or removes touch effects.You can see how I use that template in
MainPage.xaml
.When run, application will not have any touch effects. Press the 'Change Template' button on the top in order to trigger a property change and therefore add effects to the ItemTemplate.
After that you will be able to long press it.
Press the button at the top again to trigger the removal of touch effects.
On Android everything works as expected. On iOS however, long pressing an item still calls the LongPressCommand (that we removed).
Steps to Reproduce
Expected Behavior
Android and iOS behavior is the same
Actual Behavior
iOS can not remove LongPressCommand
Basic Information
Reproduction Link
https://github.com/meJevin/TouchEffectBug
The text was updated successfully, but these errors were encountered: