-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Listbox virtualized with zoom in/out (using LayoutTransformControl) issues #15712
Comments
Do you have any clue (to make a PR) for the resolution of this bug ? |
I've opened a PR with a fix for the first 2 items in this issue: #16168 Regarding item 3: this is intentional - unrealized elements are not removed unless the number of items changes such that the number of realized and unrealized elements is greater than the item count. This is because when scrolling through items with variable heights, the number of required elements changes frequently and so they may be required later. |
) * Add a failing test for #15712. * Validate StartU at the start of a measure pass. If any container U size has changed since the last layout pass then `StartU` must be considered unstable as the average container height will have changed. * Correctly position focused element. If the focused element has been moved outside the visible viewport due to a realized container size change, then we need to ensure it's positioned correctly. * We can skip check if StartU is already unstable. * Don't invalidate virt. panels more than necessary. * Add another virt panel test. And revert the expected results for another test to the way they were at the beginning of this PR. * Tweak container size estimation. Use the desired size of _measured_ containers instead of the bounds: a layout pass may not had completed on the containers yet, so the bounds may not be up-to-date. Was easier to move the estimation methods out of `RealizedStackElements` and into `VirtualizingStackPanel` itself in order to do this, and arguably makes more sense.
) * Add a failing test for #15712. * Validate StartU at the start of a measure pass. If any container U size has changed since the last layout pass then `StartU` must be considered unstable as the average container height will have changed. * Correctly position focused element. If the focused element has been moved outside the visible viewport due to a realized container size change, then we need to ensure it's positioned correctly. * We can skip check if StartU is already unstable. * Don't invalidate virt. panels more than necessary. * Add another virt panel test. And revert the expected results for another test to the way they were at the beginning of this PR. * Tweak container size estimation. Use the desired size of _measured_ containers instead of the bounds: a layout pass may not had completed on the containers yet, so the bounds may not be up-to-date. Was easier to move the estimation methods out of `RealizedStackElements` and into `VirtualizingStackPanel` itself in order to do this, and arguably makes more sense.
) * Add a failing test for #15712. * Validate StartU at the start of a measure pass. If any container U size has changed since the last layout pass then `StartU` must be considered unstable as the average container height will have changed. * Correctly position focused element. If the focused element has been moved outside the visible viewport due to a realized container size change, then we need to ensure it's positioned correctly. * We can skip check if StartU is already unstable. * Don't invalidate virt. panels more than necessary. * Add another virt panel test. And revert the expected results for another test to the way they were at the beginning of this PR. * Tweak container size estimation. Use the desired size of _measured_ containers instead of the bounds: a layout pass may not had completed on the containers yet, so the bounds may not be up-to-date. Was easier to move the estimation methods out of `RealizedStackElements` and into `VirtualizingStackPanel` itself in order to do this, and arguably makes more sense.
Describe the bug
If we use a ListBox with a LayoutTransformControl in the ListBoxItem to be able to zoom in/out, there are some issues :
If I slide to an item, then zoom out and scroll to the first item, there are a space left before the first item :
If I zoom out, select an item, then zoom in (until the selected item goes out of the viewport), the selected item will be still displayed with the old position
at launch, there are one ListBoxItem realized, if I zoom out, of course more items will be realized. But if I zoom in again, the max number of ListBoxItem will remain (of course they will be empty). It should be better to flush those item.
To Reproduce
Here is the sample to reproduce :
https://github.com/Whiletru3/Avalonia/tree/VirtualizationImagesSample/samples/VirtualizationImages
Expected behavior
The ListBox should react normally using a LayoutTransformControl
Avalonia version
11.0.10, 11.1
OS
Windows, macOS
Additional context
No response
The text was updated successfully, but these errors were encountered: