Skip to content

StaggeredLayout ItemsStretch Fill unstable when resizing #571

@michael-hawker

Description

@michael-hawker

Describe the bug

I notice this a lot more with WinUI 3, but also occurs with UWP. If you are resizing the window with the StaggeredLayout, it'll jump between where to put the items for filling the columns or not, it's probably on an edge case where it's not sure which one to do?

See the screenshot below for when it's in a bad state, but if you resize you can get to a point where the layout will flicker as you adjust the window. Recorded a video too.

FYI @Poker-sang, if you can help. I'll be pushing up an update soon with an updated CsWinRT version which should allow running this sample on main.

Otherwise just update WinAppSDK.props with the following for now locally:

    <PackageReference Condition="'$(HasWinUI)' == 'true'" Include="Microsoft.WindowsAppSDK" Version="1.6.241114003" />
    <PackageReference Condition="'$(HasWinUI)' == 'true'" Include="Microsoft.Windows.CsWinRt" Version="2.2.0" PrivateAssets="all"/>

Steps to reproduce

1. Open the primitives component
2. Run the sample app in UWP or WASDK (easier to see with WASDK)
3. Go to the StaggeredLayout sample
4. Set ItemsStretch to Fill
5. Resize window, see issue

Expected behavior

No flicker/stable layout

Screenshots

Image

StaggeredLayoutFlicker.mp4

Code Platform

  • UWP
  • WinAppSDK / WinUI 3
  • Web Assembly (WASM)
  • Android
  • iOS
  • MacOS
  • Linux / GTK

Windows Build Number

  • Windows 10 1809 (Build 17763)
  • Windows 10 1903 (Build 18362)
  • Windows 10 1909 (Build 18363)
  • Windows 10 2004 (Build 19041)
  • Windows 10 20H2 (Build 19042)
  • Windows 10 21H1 (Build 19043)
  • Windows 10 21H2 (Build 19044)
  • Windows 10 22H2 (Build 19045)
  • Windows 11 21H2 (Build 22000)
  • Other (specify)

Other Windows Build number

No response

App minimum and target SDK version

  • Windows 10, version 1809 (Build 17763)
  • Windows 10, version 1903 (Build 18362)
  • Windows 10, version 1909 (Build 18363)
  • Windows 10, version 2004 (Build 19041)
  • Windows 10, version 2104 (Build 20348)
  • Windows 11, version 22H2 (Build 22000)
  • Other (specify)

Other SDK version

No response

Visual Studio Version

No response

Visual Studio Build Number

No response

Device form factor

Desktop

Additional context

Running from main

Help us help you

Yes, but only if others can assist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority-1bugSomething isn't workingux 🖌️Everything design related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions