Browse Source

Made the requested changes

Jurjen Biewenga 8 years ago
parent
commit
3081a07f1c
1 changed files with 7 additions and 10 deletions
  1. 7 10
      src/Avalonia.Controls/DropDown.cs

+ 7 - 10
src/Avalonia.Controls/DropDown.cs

@@ -104,7 +104,7 @@ namespace Avalonia.Controls
             if (!e.Handled)
             {
                 if (e.Key == Key.F4 ||
-                    (e.Key == Key.Down && ((e.Modifiers & InputModifiers.Alt) != 0)))
+                    ((e.Key == Key.Down || e.Key == Key.Up) && ((e.Modifiers & InputModifiers.Alt) != 0)))
                 {
                     IsDropDownOpen = !IsDropDownOpen;
                     e.Handled = true;
@@ -117,24 +117,21 @@ namespace Avalonia.Controls
 
                 if (!IsDropDownOpen)
                 {
-                    if (e.Key == Key.Right)
+                    if (e.Key == Key.Down)
                     {
+                        if (SelectedIndex == -1)
+                            SelectedIndex = 0;
+                        
                         if (++SelectedIndex >= ItemCount)
                             SelectedIndex = 0;
                         
                         e.Handled = true;
                     }
-                    else if (e.Key == Key.Left)
+                    else if (e.Key == Key.Up)
                     {
                         if (--SelectedIndex < 0)
                             SelectedIndex = ItemCount - 1;
-                        e.Handled = true;
-                    }
-                    else if (e.Key == Key.Down)
-                    {
-                        IsDropDownOpen = true;
-                        if (SelectedIndex == -1)
-                            SelectedIndex = 0;
+                        
                         e.Handled = true;
                     }
                 }