Parcourir la source

Don't consider disabled controls when moving focus.

Fixes #3426.
Steven Kirk il y a 5 ans
Parent
commit
e994b855d5
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 4 1
      src/Avalonia.Controls/ItemsControl.cs

+ 4 - 1
src/Avalonia.Controls/ItemsControl.cs

@@ -472,7 +472,10 @@ namespace Avalonia.Controls
                 result = container.GetControl(direction, c, wrap);
                 from = from ?? result;
 
-                if (result?.Focusable == true)
+                if (result != null &&
+                    result.Focusable &&
+                    result.IsEffectivelyEnabled &&
+                    result.IsEffectivelyVisible)
                 {
                     return result;
                 }