Skip to content

Conversation

@AndrewKeepCoding
Copy link
Contributor

Fixes #743

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

The following code fails to render the last child (orange).

<controls:WrapPanel Width="132" StretchChild="Last">
    <Rectangle Width="44" Height="44" Fill="Red" />
    <Rectangle Width="44" Height="44" Fill="Blue" />
    <Rectangle Width="44" Height="44" Fill="Green" />
    <Rectangle Height="44" Fill="Orange" />
</controls:WrapPanel>
image

What is the new behavior?

The last child (orange) is rendered in a new row as expected.

image

PR Checklist

Please check if your PR fulfills the following requirements:

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • Tested code with current supported SDKs
  • New component
    • Documentation has been added
    • Sample in sample app has been added
    • Analyzers are passing for documentation and samples
    • Icon has been created (if new sample) following the Thumbnail Style Guide and templates
  • Tests for the changes have been added (if applicable)
  • Header has been added to all new source files
  • Contains NO breaking changes

Other information

Added an additional condition to the `WrapPanel` class to improve layout behavior. The new logic checks if `position.U` is greater than or equal to `parentMeasure.U`, ensuring the panel wraps to the next row when necessary. This change helps maintain proper alignment and spacing within the panel.
@michael-hawker
Copy link
Member

michael-hawker commented Dec 10, 2025

Android CI failure from uno check
WASDK CI failure from ComplexAsyncLoadUIExampleTest ColorPicker test (which is just a default test, not sure why that's causing hold-up)

Rekicked as intermittent

@michael-hawker
Copy link
Member

Thanks @AndrewKeepCoding! For some reason I thought you already had a PR open for this. I appreciate you following up on this. @Arlodotexe another one we should get merged in for 8.2 hotfix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New row not created for last child in WrapPanel when StretchChild=Last

2 participants