bugfix dropdown closing by ESC
This commit is contained in:
@@ -354,6 +354,7 @@ namespace FasdDesktopUi.Basics.UserControls
|
||||
if (treeViewControl != null)
|
||||
{
|
||||
treeViewControl.SelectedItemChanged += TreeViewControl_SelectedItemChanged;
|
||||
treeViewControl.PreviewKeyDown += DropDownContent_PreviewKeyDown;
|
||||
treeViewControl.ItemsSource = VisibleItems;
|
||||
}
|
||||
}
|
||||
@@ -362,7 +363,10 @@ namespace FasdDesktopUi.Basics.UserControls
|
||||
{
|
||||
searchTextBox = ComboBoxControl.Template.FindName("PART_SearchTextBox", ComboBoxControl) as TextBox;
|
||||
if (searchTextBox != null)
|
||||
{
|
||||
searchTextBox.TextChanged += SearchTextBox_TextChanged;
|
||||
searchTextBox.PreviewKeyDown += DropDownContent_PreviewKeyDown;
|
||||
}
|
||||
}
|
||||
|
||||
if (itemsScrollViewer == null)
|
||||
@@ -408,6 +412,15 @@ namespace FasdDesktopUi.Basics.UserControls
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void DropDownContent_PreviewKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key != Key.Escape)
|
||||
return;
|
||||
|
||||
if (CloseDropDownIfOpen())
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Keyboard
|
||||
|
||||
Reference in New Issue
Block a user