Skip to content
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

Fix overlapping items in VirtualizingStackPanel #13765

Merged
merged 2 commits into from Nov 28, 2023

Conversation

grokys
Copy link
Member

@grokys grokys commented Nov 28, 2023

What does the pull request do?

As described in #12744, sometimes items in a virtualized ItemsControl would start overlapping.

The reason is simple: inserting items before the current viewport should cause RealizedStackElements to mark StartU as unstable because we don't now actually know the start U position any more (we haven't measured the inserted item).

This is a port of a fix for TreeDataGrid but this time I actually wrote a simple unit test which tests the source of the problem (although a unit test for the actual visible effect of this bug is a lot more difficult, and I've still not managed to repro in a unit test).

Fixed issues

Fixes #12744
Part of #13736

Copy link
Member

@MrJul MrJul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested against the sample from #12744. LGTM!
I didn't expect a one line fix, nice :)

@MrJul MrJul added this pull request to the merge queue Nov 28, 2023
@MrJul MrJul added the backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch label Nov 28, 2023
Merged via the queue into master with commit b630f21 Nov 28, 2023
7 checks passed
@MrJul MrJul deleted the fixes/12744-overlapping-virtualized-items branch November 28, 2023 22:15
@CodeDevAM
Copy link

Awesome! Thank you very much!
Will this fix be included in 11.0.6?

@timunie
Copy link
Contributor

timunie commented Dec 4, 2023

Will this fix be included in 11.0.6?

probably, yes. At least it's planned. Will be available in nightly and 11.1 for sure. So if you need this fix faster, try nightly for now.

maxkatz6 pushed a commit that referenced this pull request Dec 5, 2023
* Added failing test for #12744.

* Inserting items makes the StartU unstable.

This ports the fix in AvaloniaUI/Avalonia.Controls.TreeDataGrid#229 to Avalonia.

Fixes #12744
#Conflicts:
#	tests/Avalonia.Controls.UnitTests/VirtualizingStackPanelTests.cs
@maxkatz6 maxkatz6 added backported-11.0.x and removed backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch labels Dec 5, 2023
@CodeDevAM
Copy link

Will this fix be included in 11.0.6?

probably, yes. At least it's planned. Will be available in nightly and 11.1 for sure. So if you need this fix faster, try nightly for now.

Is there some kind of release schedule?

@jp2masa
Copy link
Contributor

jp2masa commented Dec 5, 2023

Is there some kind of release schedule?

As you can see, this PR has the backported-11.0.x tag, so it will appear in 11.0.6.

There also seems to be a new git tag for 11.0.6, so it may be released soon. The 11.0.6 packages appear in the nightly feed, if you want to test.

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.

ListBox/VirtualizingStackPanel places several items at the same "line"
6 participants