Repository navigation
Fix pending WrapPanel layout bugs - #11507
Open
Niels Laute (niels9001) wants to merge 3 commits into
Open
Niels Laute (niels9001) wants to merge 3 commits into
Niels Laute (niels9001) wants to merge 3 commits into
Conversation
Niels Laute (niels9001)
requested a review
from Alexandre Zollinger Chohfi (azchohfi)
August 11, 2026 09:31
Port the remaining Community Toolkit fixes for infinite-axis stretching and exact-boundary wrapping, with horizontal and vertical regression coverage. Original fixes authored by AndrewKeepCoding in CommunityToolkit/Windows PRs microsoft#704 and microsoft#759. Co-authored-by: AndrewKeepCoding <80524586+AndrewKeepCoding@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 51f05dcb-e574-492d-ba19-1e35322cab67
Niels Laute (niels9001)
force-pushed
the
fix/wrappanel-wct-bugfixes
branch
from
August 11, 2026 10:11
35c795e to
e4b7be6
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR ports two pending Windows Community Toolkit WrapPanel behavior fixes into WinUI’s WrapPanel implementation, addressing edge cases around ItemsStretch="Last" when the primary axis is unconstrained (infinite) and when a line exactly fills the available space.
Changes:
- Prevent stretching the last item to an infinite size when the panel is measured with an unconstrained primary axis.
- Force a wrap when the current line exactly fills the available primary-axis space, enabling correct wrapping/stretching for a zero-desired-size final item.
- Add API regression tests covering both horizontal/vertical orientations for the above scenarios.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| controls/dev/WrapPanel/WrapPanel.cpp | Updates wrap and stretch logic to handle infinite primary-axis measurement and exact-boundary wrapping. |
| controls/dev/WrapPanel/APITests/WrapPanelTests.cs | Adds regression tests for infinite primary-axis measure and exact-boundary wrap behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Include end padding in the exact-boundary wrap check and cover horizontal and vertical zero-sized last-child layouts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Niels Laute (niels9001)
requested review from
Hitesh Kumar (hiteshkrmsft) and
Abhijeet Jha (iamAbhi-916)
October 7, 2026 06:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Ports the two remaining Community Toolkit WrapPanel fixes that were identified during the WinUI API-review follow-up but were still pending in the WinUI implementation:
The API naming updates from #10858 were already completed; this PR closes the remaining behavioral gaps from the original Community Toolkit implementation:
StretchChild=Last, fixed by CommunityToolkit/Windows#759.Both original fixes and their tests were authored by @AndrewKeepCoding. This WinUI port retains that attribution in the commit metadata.
Testing
Added API regression coverage for both horizontal and vertical orientations, covering infinite primary-axis measurement and exact-boundary wrapping with
ItemsStretch="Last".