Browse Source

Removed non-working code.

And replace it with a TODO.
pull/2603/head
Steven Kirk 7 years ago
parent
commit
b26ec44374
  1. 33
      src/Avalonia.Controls/Repeater/ViewManager.cs

33
src/Avalonia.Controls/Repeater/ViewManager.cs

@ -6,6 +6,7 @@
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using Avalonia.Controls.Templates;
using Avalonia.Input;
using Avalonia.Interactivity;
@ -180,38 +181,10 @@ namespace Avalonia.Controls
}
}
// Find the next element if one exists, if not use the previous element.
// TODO: Find the next element if one exists, if not use the previous element.
// If the container itself is not focusable, find a descendent that is.
IControl focusCandidate = null;
if (nextElement != null)
{
focusCandidate = nextElement as IControl;
if (focusCandidate != null)
{
var firstFocus = KeyboardNavigationHandler.GetNext(nextElement, NavigationDirection.First);
if (firstFocus != null)
{
focusCandidate = firstFocus as IControl;
}
}
}
if (focusCandidate == null && previousElement != null)
{
focusCandidate = previousElement as IControl;
if (previousElement != null)
{
var lastFocus = KeyboardNavigationHandler.GetNext(previousElement, NavigationDirection.Last);
if (lastFocus != null)
{
focusCandidate = lastFocus as IControl;
}
}
}
return focusCandidate;
return nextElement;
}
public int GetElementIndex(VirtualizationInfo virtInfo)

Loading…
Cancel
Save