maui icon indicating copy to clipboard operation
maui copied to clipboard

Scrolling a CollectionView with SwipeView items causes exception on Windows

Open pekspro opened this issue 3 years ago • 2 comments
trafficstars

Description

If you have a CollectionView where SwipeView is used in the DataTemplate and you are scrolling, you will eventually get an unhandled exception:

image

This seems to only happens on Windows. I have tested on Android too, and there it's fine.

Steps to Reproduce

  1. Create a new MAUI-application.
  2. 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>
  1. Update MainPage.cs:
public partial class MainPage : ContentPage
{
	public MainPage()
	{
		InitializeComponent();

        Items = TimeZoneInfo.GetSystemTimeZones().ToList();

        BindingContext = this;
        
	}

    public List<TimeZoneInfo> Items { get; }
}
  1. Run the application on Windows.
  2. 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

pekspro avatar Jun 04 '22 18:06 pekspro

can be reproduced on windows with above project. vs version 17.3.0 Preview 3.0 [32605.41.main].

kristinx0211 avatar Jun 06 '22 07:06 kristinx0211

I've updated sample application to .NET 7. The same issue remains.

pekspro avatar Nov 11 '22 17:11 pekspro

I can confirm this issue still remains in 8.0.100-rc.2.23502.2 is this going to get resolved for .net 8 ?

KeithBoynton avatar Nov 08 '23 18:11 KeithBoynton

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 Scroll

XamlTest avatar Nov 24 '23 06:11 XamlTest

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.

ghost avatar Nov 24 '23 06:11 ghost