Browse Source

Removed non-working code.

And replace it with a TODO.
Steven Kirk 6 năm trước cách đây
mục cha
commit
b26ec44374

+ 3 - 30
src/Avalonia.Controls/Repeater/ViewManager.cs

@@ -6,6 +6,7 @@
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Collections.Specialized;
 using System.Collections.Specialized;
+using System.Linq;
 using Avalonia.Controls.Templates;
 using Avalonia.Controls.Templates;
 using Avalonia.Input;
 using Avalonia.Input;
 using Avalonia.Interactivity;
 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.
             // 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)
         public int GetElementIndex(VirtualizationInfo virtInfo)