Skip to content

Commit 89f4519

Browse files
timunieCopilot
andauthored
Refactor scrollToIndex handling in VirtualizingStackPanel
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent f4addd5 commit 89f4519

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/Avalonia.Controls/VirtualizingStackPanel.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -710,11 +710,10 @@ protected internal override int IndexFromContainer(Control container)
710710
_scrollToElement = null;
711711
_scrollToIndex = -1;
712712
RecycleElement(unadoptedScrollToElement, unadoptedScrollToIndex);
713+
return null;
713714
}
714-
else
715-
{
716-
_scrollToIndex = -1;
717-
}
715+
716+
_scrollToIndex = -1;
718717
return scrollToElement;
719718
}
720719

0 commit comments

Comments
 (0)