From b26ec443749c8186c2d1b3aeed3f760280f56dd7 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Thu, 4 Jul 2019 12:04:11 +0200 Subject: [PATCH] Removed non-working code. And replace it with a TODO. --- src/Avalonia.Controls/Repeater/ViewManager.cs | 33 ++----------------- 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/src/Avalonia.Controls/Repeater/ViewManager.cs b/src/Avalonia.Controls/Repeater/ViewManager.cs index b90f8dacfe..833e708e9e 100644 --- a/src/Avalonia.Controls/Repeater/ViewManager.cs +++ b/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)