From d69249a4e6e979144759e14609a1773ab8f584e8 Mon Sep 17 00:00:00 2001 From: M Pylon <164873743+mpylon@users.noreply.github.com> Date: Tue, 16 Jul 2024 20:03:12 -0400 Subject: [PATCH] Fixes #16346 --- src/Avalonia.Controls/VirtualizingStackPanel.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Avalonia.Controls/VirtualizingStackPanel.cs b/src/Avalonia.Controls/VirtualizingStackPanel.cs index e235d314748..7934e0ccc6b 100644 --- a/src/Avalonia.Controls/VirtualizingStackPanel.cs +++ b/src/Avalonia.Controls/VirtualizingStackPanel.cs @@ -842,6 +842,8 @@ private void RecycleElementOnItemRemoved(Control element) { Debug.Assert(ItemContainerGenerator is not null); + _scrollAnchorProvider?.UnregisterAnchorCandidate(element); + var recycleKey = element.GetValue(RecycleKeyProperty); if (recycleKey is null || recycleKey == s_itemIsItsOwnContainer)