Browse Source

Made the requested changes

pull/1166/head
Jurjen Biewenga 9 years ago
parent
commit
3081a07f1c
  1. 17
      src/Avalonia.Controls/DropDown.cs

17
src/Avalonia.Controls/DropDown.cs

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

Loading…
Cancel
Save