Skip to content

Fix auto-sized VirtualizingStackPanel not rendering - #22081

Merged
MrJul merged 2 commits into
AvaloniaUI:mainfrom
MrJul:fix/vsp-anchor-end
Aug 28, 2026
Merged

MrJul merged 2 commits into
AvaloniaUI:mainfrom
MrJul:fix/vsp-anchor-end

Conversation

@MrJul

@MrJul MrJul commented Aug 27, 2026

Copy link
Copy Markdown
Member

What does the pull request do?

This PR fixes a recent regression introduced in #22014: the anchor was placed at the end even when the viewport was at the beginning of the list. In other words, the first item was incorrectly placed at negative bounds, outside of the viewport.

Visually, this manifested as an empty list when a single item was present and the VirtualizingStackPanel was auto-sized (effectively disabling virtualization, but that's not a reason for it not to work correctly).

A matching unit test has been added.

@MrJul MrJul added bug regression backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch labels Aug 27, 2026
@grokys
grokys enabled auto-merge August 27, 2026 20:53
@grokys
grokys added this pull request to the merge queue Aug 27, 2026
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.2.999-cibuild0069035-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 27, 2026
@MrJul
MrJul added this pull request to the merge queue Aug 28, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 28, 2026
@MrJul
MrJul added this pull request to the merge queue Aug 28, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 28, 2026
@MrJul

MrJul commented Aug 28, 2026

Copy link
Copy Markdown
Member Author

Note: the above merge failures are two different transient issues, one being a problem with the nightly nuget feed.

@MrJul
MrJul added this pull request to the merge queue Aug 28, 2026
Merged via the queue into AvaloniaUI:main with commit 11593a7 Aug 28, 2026
11 checks passed
@MrJul
MrJul deleted the fix/vsp-anchor-end branch August 28, 2026 10:11
MrJul added a commit to MrJul/Avalonia that referenced this pull request Sep 2, 2026
* Add failing test for auto-sized VSP

* Fix auto-sized VirtualizingStackPanel not rendering
@MrJul MrJul added backported-12.1.x and removed backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch labels Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants