Browse Source

Correctly handle scrolling in TreeView.

wip/use-selectionmodel
Steven Kirk 6 years ago
parent
commit
c91863f46a
  1. 9
      src/Avalonia.Controls/TreeView.cs

9
src/Avalonia.Controls/TreeView.cs

@ -323,13 +323,8 @@ namespace Avalonia.Controls
{ {
if (e.PropertyName == nameof(SelectionModel.AnchorIndex)) if (e.PropertyName == nameof(SelectionModel.AnchorIndex))
{ {
var index = Selection.AnchorIndex.GetSize() > 0 ? Selection.AnchorIndex.GetAt(0) : -1; var container = ContainerFromIndex(Selection.AnchorIndex);
var item = index != -1 ? ElementAt(Items, index) : null; container?.BringIntoView();
if (item != null)
{
//ScrollIntoView(item);
}
} }
} }

Loading…
Cancel
Save