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))
{
var index = Selection.AnchorIndex.GetSize() > 0 ? Selection.AnchorIndex.GetAt(0) : -1;
var item = index != -1 ? ElementAt(Items, index) : null;
if (item != null)
{
//ScrollIntoView(item);
}
var container = ContainerFromIndex(Selection.AnchorIndex);
container?.BringIntoView();
}
}

Loading…
Cancel
Save