Skip to content

Commit

Permalink
Merge pull request #220 from AvaloniaUI/fixes/scroll-anchor-unregister
Browse files Browse the repository at this point in the history
Unregister anchor candidates on unrealize.
  • Loading branch information
grokys authored Sep 30, 2023
2 parents d45db09 + 9cccb9f commit bbe7806
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ private void RecycleElement(Control element, int index)
UnrealizeElement(element);
element.IsVisible = false;
ElementFactory!.RecycleElement(element);
_scrollViewer?.UnregisterAnchorCandidate(element);
}
}

Expand All @@ -663,6 +664,7 @@ private void RecycleElementOnItemRemoved(Control element)
UnrealizeElementOnItemRemoved(element);
element.IsVisible = false;
ElementFactory!.RecycleElement(element);
_scrollViewer?.UnregisterAnchorCandidate(element);
}

private void TrimUnrealizedChildren()
Expand Down

0 comments on commit bbe7806

Please sign in to comment.