-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Wrong item is registered when pressing an item in a CollectionView using TouchBehavior #1865
Comments
Isn't it a duplicate of #1804 ? |
It could be, but for me regressing to 8.0.0 didn't work for me. I have the same issue whatever version I use |
From what I can see the issue is the same as #1804. @TiicTac54 can you test the nuget generated by this PR and tell me if that fixes your issue |
how can I test the nuget generated by the PR? do you have the link? |
@pictos I tried your fix and it works for android, but not for iOS. On iOS, the first press can be wrong, but if I do not scroll the second press will always be right. Adding ItemSizingStrategy="MeasureFirstItem" on the collectionView fixes the issue. However, that property with the TouchBehavior breaks on Android. Finally, the issue (on iOS) only seems to occurs when navigating to a page from the collectionView, coming back and then press a new item. If I remove the navigation part, it works with no problem (fix and without the fix) |
@TiicTac54 thanks for the info and try out, I'll see if I can address it on my current PR |
Run into same issue. When navigating into a sub page and navigate back than the registered item is wrong. |
This one bit me today <CollectionView.ItemTemplate>
<DataTemplate x:DataType="foot:DebugCommand">
<Grid>
<Border x:Name="AdvancedView"
Margin="16,0"
Style="{StaticResource AppGradientBorderNoOutline}">
<Border.Behaviors>
<mct:TouchBehavior DefaultAnimationDuration="250"
Command="{Binding Command}"
DefaultAnimationEasing="{x:Static Easing.SpringOut}"
PressedScale=".95" />
</Border.Behaviors>
<Grid ColumnDefinitions="Auto, *" ColumnSpacing="16">
<Label Grid.Column="0"
Text="{StaticResource CircleDot}"
TextColor="{Binding Command.IsRunning, Converter={StaticResource IsExecutingToColorConverter}}"
FontSize="18"
FontFamily="FontAwesome-Solid"
VerticalOptions="Center" />
<Label Grid.Column="1"
Text="{Binding Title}"
TextColor="{StaticResource TitleTextColor}"
VerticalOptions="Center"
FontSize="18" />
</Grid>
</Border>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate> I'm literally binding the command to a command property in the datasource |
Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
When I press an item in a CollectionView using a TouchBehavior, another item is recorded as pressed.
Screen.Recording.2024-05-08.at.12.00.52.PM.mov
Here's how I configure my TouchBehavior on each element of my list
Expected Behavior
If I press any item in the CollectionView, only the one I press should be registered.
Steps To Reproduce
Link to public reproduction project repository
https://github.com/TiicTac54/TouchBehaviorBugWithCollectionView.git
Environment
Anything else?
Using a TapGestureRecognizer does not cause this issue.
The text was updated successfully, but these errors were encountered: