-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
List virtualization fixes #10285
List virtualization fixes #10285
Conversation
- Before we were clamping indexes too early, meaning that `firstIndexU` was calculated with a non-clamped index - `_startUUnstable` needs to be set when the remove happens before the realized elements
If viewport or extent were changed, this could affect the current offset so make sure we coerce the offset during arrange.
You can test this PR using the following package version. |
@grokys maybe it's a bit off topic for this PR, but my app crashes on index out of range due toto this method giving a negative index using ItemsControl - https://github.com/AvaloniaUI/Avalonia/blob/7da9bb9d434ecb70e5ef2fc7af768067c43709f1/src/Avalonia.Controls/VirtualizingStackPanel.cs#LL491C28-L491C28 |
@adirh3 i don't suppose you have a minimal repro do you? Hard to know what's going wrong from just your description. |
As usual I can't repro anything outside of my app :/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge it, and see if somebody will find a repro for the master branch.
You can test this PR using the following package version. |
In the absence of a repro, a stacktrace might help. |
@grokys is this maybe related? #10399 (comment) If so, the issue seems not to be solved yet. |
Will give stack trace later today. |
What does the pull request do?
Fixes some issues with the new virtualization system introduced in #9677:
VirtualizingStackPanel.MeasureOverride
. This was broken previously due to two problems:_startUUnstable
when items were removed before the realized rangefirstIndexU
was calculated with a non-clamped index, which caused the items to be realized in the wrong positionScrollContentPresenter
whereby if the viewport or extent were changed the offset wasn't being coerced, leading to an offset beyond the extent of the scroll