Skip to content
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

ArgumentOutOfRange exception when scrolling ItemRepeater with images too fast #10281

Open
FrozenAssassine opened this issue Jan 7, 2025 · 4 comments
Labels
area-ItemsRepeater bug Something isn't working Crash whenever user reports a crash or app freeze

Comments

@FrozenAssassine
Copy link

FrozenAssassine commented Jan 7, 2025

Describe the bug

I have an ItemsRepeater and attached to it is an AnnotatedScrollBar. When I scroll up and down pretty fast. The whole app crashes and throws the "System.ArgumentOutOfRangeException" in WinRT.Runtime.dll

I have only tested with images. Maybe it happens even with something else, but images are my main thing to show there so that's what I tested for.

As you can also see in the video, when I start scrolling everything works, it's not even a problem, that the images do not render directly. I guess it's normal due to the virtualization. The problem appears after some time, when the app starts with the loading cursor and becomes completely unresponsive.

Steps to reproduce the bug

<ScrollView x:Name="imageItemRepeaterScroller" Grid.Column="0" HorizontalScrollMode="Disabled" VerticalScrollBarVisibility="Hidden">
    <ItemsRepeater x:Name="imageRenderer">
        <ItemsRepeater.Layout>
            <LinedFlowLayout ItemsStretch="Fill" LineHeight="160" LineSpacing="5" MinItemSpacing="5"/>
        </ItemsRepeater.Layout>
        <ItemsRepeater.ItemTemplate>
            <DataTemplate x:DataType="x:String">
                <Image Source="{x:Bind }" Stretch="UniformToFill" />
            </DataTemplate>
        </ItemsRepeater.ItemTemplate>
    </ItemsRepeater>
</ScrollView>
<AnnotatedScrollBar Grid.Column="1" 
    x:Name="annotatedScrollBar"
    Margin="4,0,48,0"
    VerticalAlignment="Stretch"
    HorizontalAlignment="Right"
    Loaded="annotatedScrollBar_Loaded"/>
private void annotatedScrollBar_Loaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
{
    imageItemRepeaterScroller.ScrollPresenter.VerticalScrollController = annotatedScrollBar.ScrollController;
}

//load some images:
var images = Directory.GetFiles("C:\\Users\\MYUSER\\Pictures\\Screenshots");
var items = new ObservableCollection<string>(images);
imageRenderer.ItemsSource = items;

Now launch the app, you should see a list of 200 screenshots. Hope you have, otherwise maybe select a different folder. Now start scrolling really fast up and down using the annotatedScrollBar and at some point the app will crash with a "System.ArgumentOutOfRangeException" in WinRT.Runtime.dll exception.

Expected behavior

I don't want it to crash. There is no problem if it loads or shows nothing for a short time, but a crash is
inappropriate.

Screenshots

Bildschirmaufnahme.2025-01-07.144349.mp4

NuGet package version

WinUI 3 - Windows App SDK 1.6.3: 1.6.241114003

Windows version

Windows 11 (24H2): Build 26100

Additional context

No response

@FrozenAssassine FrozenAssassine added the bug Something isn't working label Jan 7, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Jan 7, 2025
Copy link

github-actions bot commented Jan 7, 2025

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@FrozenAssassine
Copy link
Author

Well, the same thing as described in #7743 but the issue is closed as not planned, so I opened a new one.
Also one thing, the annotatedScrollViewer has nothing to do with the actual crash as I thought initially.

@FrozenAssassine
Copy link
Author

On another device, the app will not even start with too many items in the itemsRepeater. This is so wrong. Please fix!

@karkarl
Copy link
Contributor

karkarl commented Jan 13, 2025

Thanks for filing this issue. It looks like the last bug was stale and closed automatically.

@karkarl karkarl added area-ItemsRepeater Crash whenever user reports a crash or app freeze and removed needs-triage Issue needs to be triaged by the area owners labels Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-ItemsRepeater bug Something isn't working Crash whenever user reports a crash or app freeze
Projects
None yet
Development

No branches or pull requests

2 participants