AndreiMisiukevich / TouchEffect

UI-responsive touch effects for Xamarin.Forms
MIT License
195 stars 33 forks source link

[iOS] ListView items with TouchEff.NativeAnimation stop being tappable when user slides finger and it exits the native animation #77

Closed MitchBomcanhao closed 4 years ago

MitchBomcanhao commented 4 years ago

TouchView 4.1.78 iOS 14.0.1 XF 4.8.0 sr3 Rg.Plugins.Popup 2.0.0.3

I've got a page with a list of items, structured as shown below (simplified to the basics) If I put a finger on an item, it'll change colour slightly (as per NativeAnimation setting on iOS). If I then move the finger slightly, the NativeAnimation effect goes away, which is expected, as it starts switching into scrolling the list. You can now observe that:

The weird part is that I've got another page with a similar ListView and on that other page (which is not a popup page) and I can't reproduce the issue there at all. Unfortunately I am unable to debug the iOS app at the moment, so I can only report on what I can see, and not on is happening under the hood.

Any ideas on what might be happening?

<popup:PopupPage>   
    <Grid>
        <ListView BindingContext="{Binding}"
                  HasUnevenRows="True"
                  HorizontalOptions="Fill"
                  HorizontalScrollBarVisibility="Never"
                  IsPullToRefreshEnabled="False"
                  ItemTapped="Item_Tapped"
                  ItemsSource="{Binding Items}"
                  SelectionMode="None"
                  SeparatorVisibility="None"
                  VerticalOptions="Start">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <ViewCell>
                        <ViewCell.View>
                            <Grid BackgroundColor="{DynamicResource ThemedItem}"
                                  ColumnDefinitions="Auto,*,Auto"
                                  RowDefinitions="Auto"
                                  RowSpacing="0"
                                  touch:TouchEff.NativeAnimation="True">
                                <Label Grid.Row="0"
                                       Grid.Column="0"
                                       LineBreakMode="TailTruncation"
                                       Text="{Binding Number}"
                                       VerticalOptions="Center" />

                                <Label Grid.Row="0"
                                       Grid.Column="1"
                                       LineBreakMode="TailTruncation"
                                       Text="{Binding Title}"
                                       VerticalOptions="Center" />
                                <Label Grid.Column="2"
                                       Text="edit"
                                       VerticalOptions="Center" />
                            </Grid>
                        </ViewCell.View>
                    </ViewCell>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
    </Grid>
</popup:PopupPage>
AndreiMisiukevich commented 4 years ago

Frankly speaking, I have no idea why it can happen :(

MitchBomcanhao commented 4 years ago

I'm sure I can find several workarounds for this but if I have the chance to debug this behaviour in the future I'll have a look. From your answer I assume you've come across this issue as well - not sure I'll be able to do any better but I can try :)

edit: my first idea to get this working more reliably is to switch the itemTapped event to a toucheff command on the item itself, and after a very brief experiment it does appear to work, but requires more code changes than what I hoped to get when just adding the touch effect. Might also be picking up other issues when trying to make things prettier, which is always a risk.

AndreiMisiukevich commented 4 years ago

Please use TouchEff command instead ItemTapped event in this scenario 👍 I think this workaround is enough for now