-
Notifications
You must be signed in to change notification settings - Fork 677
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
Layout cycle detected (crash) for some list view sizes when scrolling to end of listview #6218
Comments
@RBrid and @codendone FYI |
This issue is happening all over the place where I am using listviews. It also happens for lists without group headers. |
Any news on this issue that is blocking our project for weeks now? @gabbybilka, @marb2000, @ryandemopoulos, @SavoySchuler |
@wbokkers is this still occurring in 1.0? |
@gabbybilka Yes, it occurs mainly in 1.0. It is a very frequent crash. I think I have seen this occur in 0.8 as well, but only a couple of times. |
I added a new way to reproduce this issue. It's just a matter of using the test control to immediately crash the app. |
@gabbybilka Any news on this and other open issues? The silence is deafening. 🦻 |
It's getting into an infinite loop where layout A is triggering a response to change layout to B, and that's triggering a response to change layout to A, B, A, ... until it hits the max layout count. Certainly that's not supposed to happen, but it appears to be an issue in the ScrollBar track layout code getting triggered by ItemsStackPanel.ItemsUpdatingScrollMode; removing that stops the cycle: <ListView.ItemsPanel>
<ItemsPanelTemplate>
<ItemsStackPanel VerticalAlignment="Bottom" ItemsUpdatingScrollMode="KeepLastItemInView" />
</ItemsPanelTemplate>
</ListView.ItemsPanel> |
@MikeHillberg Thanks for locating what's causing this issue. Unfortunately, removing ItemsUpdatingScrollMode is not an option. I need to keep the last item in view as soon as one arrives in the list view. (it's a chat-like experience). Removing ItemsUpdatingScrollMode and using my own code to scroll to the last item will also trigger a layout cycle (less frequent) and I can't always get it to scroll down completely using this method. So there's no good workaround. It would be great if this issue could be resolved in the 1.0 release as a quality update. (edit: tried to use a less irritated and impatient tone.. not my forte) |
@MikeHillberg @gabbybilka Any news on the status? This is the crash report of te latest version of our app, with Windows App SDK 1.0. |
Adding @ranjeshj. |
@MikeHillberg @ranjeshj |
You can see the crash happen for this simple XAML: <ScrollViewer
Margin="12,8"
Height="427.2">
<StackPanel>
<Border Margin="8" Height="192" Background="Green" Width="40"/>
<Border Margin="8" Height="192" Background="Blue" Width="40"/>
<Border Margin="8" Background="Yellow" Height="30" Width="40"/>
</StackPanel>
</ScrollViewer> Note the specified Height! The content of the scroll viewer is very simple. It looks like the crash is related to the content height AND the scroll viewer height. |
@wbokkers, thank you very much for the information you provided. This looks very much like a bug I have been investigating recently. That one depends on the Scale factor used on the machine, 100%, 125%, 150%, 175%, 200%, etc... It needed 175% to repro. I tried all the Scale factors, but I could not repro the crash with the simple ScrollViewer markup above. What scale factor are you using on your machine to repro? Thank you. |
@RBrid My scale factor is 125% with a 1920x1080 resoltion. That is works with a different scale factor does not surprise me. The issue is very much dependent on the height of the scroll area and the contents, and changing the scale will change the sizes of the scroll area and the contents. |
The scale factor setting is probably why I don't see this issue occurring for all of our users. |
Changing the scale factor with only 1% will 'solve' the ScrollViewer-example on my machine. But I am not convinced that this will solve all situations. |
The XAML Controls Gallery app also crashes on some listviews when scrolling to the end of the list on my machine. This is probably the same issue: |
Thank you @wbokkers, I can repro the crash now. The reason why I did not repro earlier is because I was using a plain UWP app. I needed to make use of WinUI 2.7 which changed the control template of the ScrollViewer by adding a 1px padding around its 2 ScrollBars. |
Upgrade to 3.0 then retry. :) |
I had similar problem with my UserControl in TargetFramework: net6.0-windows10.0.19041.0
And here is my complete code-behind:
and here is my
|
@Reza-Noei Please add your SDK version and Windows version Are you using WinUI 3 or 2? |
I have updated my case, I added more info |
@bpulliam any update for this issue exists from Microsoft? I think crash bug must have high priority from Developer teams |
@marb2000 please see @Reza-Noei example for better diagnosis |
A fix for this issue has just been completed for 1.5. Fixes in |
@codendone I updated to 1.5 experimental, but I still see it occur sometimes. Was it expected to be fixed in 1.5 exp-1 ? Or is it schedule for a future release? Thanks! |
Desktop.2023.12.07.-.17.34.01.01.mp4I have attached a video showcasing that it occurs with just a basic ItemsRepeater, that is incrementally loaded based on scroll position. ItemsRepeater.Layout: <UniformGridLayout
ItemsJustification="Start"
ItemsStretch="Uniform"
MinColumnSpacing="6"
MinItemHeight="270"
MinItemWidth="200"
MinRowSpacing="12"
Orientation="Horizontal" /> |
It seems to be more frequent in 1.4.3/ But it only affects 0.02% of our users. |
@wbokkers It seems that my specific case is caused by the incremental loading mechanism of my app. I hook into the "ViewChanged" event of a ScrollView. it seems that this may cause an infinite layout cycle. Has anyone else figured out a better way of incrementally loading ItemsRepeater? P.S: The incrementalloadingcollection does not work with ItemsRepeater. |
@christosk92 i was use |
@codendone Hi I'm just wondering if the fix has already been released or not yet? I'm using WindowsAppSDK 1.5.240428000 but still have the same issue. |
Actually I tried using |
Describe the bug
I have a list view with group headers and a data template that had no issues in UWP and WinUI 3 WinAppSDK 0.8.
In WinAppSDK 1.0 Preview 3, when scrolling to the end of the list view, I get a layout cycle detected exception. But this is only the case when the listview is of a particular size. Most sizes work fine, though. The size for which the crash happens probably depends on the listview contents, but I am not sure about that.
Steps to reproduce the bug (crash on user interaction)
This issue can be reproduced using this test control:
https://gist.github.com/wbokkers/4a07fedfb99d49d4b8e8ff62971d4eb8
NOTE: Most of the time the app crashes right away for seed 9. Sometimes you need to scroll up and down using the touch pad to get the exception.
Reproduce using less code/XAML (crash on load)
The issue can be reproduced with even less and simpler code:
https://gist.github.com/wbokkers/011011af9bf95066967bd4998dca9d77
(For non-crashing situations: change the initial _seed or the listview height in the source code)
Expected behavior
There should be no layout cycle detected exception.
NuGet package version
WinUI 3 - Windows App SDK 1.0 Preview 3
Device form factor
Desktop
Windows version
May 2021 Update (19043)
The text was updated successfully, but these errors were encountered: