maui
maui copied to clipboard
Scrolling a CollectionView with SwipeView items causes exception on Windows
Description
If you have a CollectionView where SwipeView is used in the DataTemplate and you are scrolling, you will eventually get an unhandled exception:

This seems to only happens on Windows. I have tested on Android too, and there it's fine.
Steps to Reproduce
- Create a new MAUI-application.
- Update MainPage.xaml:
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MauiIssues.MainPage">
<CollectionView ItemsSource="{Binding Items}">
<CollectionView.ItemTemplate>
<DataTemplate>
<SwipeView>
<Grid>
<Label Text="{Binding Id}" />
</Grid>
</SwipeView>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ContentPage>
- Update MainPage.cs:
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
Items = TimeZoneInfo.GetSystemTimeZones().ToList();
BindingContext = this;
}
public List<TimeZoneInfo> Items { get; }
}
- Run the application on Windows.
- Scroll the list.
Full sample project: https://github.com/pekspro/MauiIssues/tree/7757_Scrolling_a_CollectionView_with_SwipeView_causes_exception
Version with bug
6.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
Windows, I was not able test on other platforms
Affected platform versions
Windows 10.0.17763.0
Did you find any workaround?
No response
Relevant log output
No response
can be reproduced on windows with above project. vs version 17.3.0 Preview 3.0 [32605.41.main].
I've updated sample application to .NET 7. The same issue remains.
I can confirm this issue still remains in 8.0.100-rc.2.23502.2 is this going to get resolved for .net 8 ?
Verified this on Visual Studio Enterprise 17.9.0 Preview 1(8.0.3). This issue does not repro on Windows 11, Android 14.0-API34, iOS 17.0 and MacCatalyst with below Project:
7757.zip
Hi @pekspro. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.
You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.