diff --git a/src/ScriptRunner/ScriptRunner.GUI/Views/SearchBox.axaml.cs b/src/ScriptRunner/ScriptRunner.GUI/Views/SearchBox.axaml.cs index 708ec77..3678acc 100644 --- a/src/ScriptRunner/ScriptRunner.GUI/Views/SearchBox.axaml.cs +++ b/src/ScriptRunner/ScriptRunner.GUI/Views/SearchBox.axaml.cs @@ -41,10 +41,11 @@ public SearchBox(IReadOnlyList viewModelActions, IReadOnlyList 0) { - FilteredItems.SelectedIndex = 0; + this.FilteredItems.Focus(); if (FilteredItems.ItemContainerGenerator.ContainerFromIndex(0) is { } item) { + FilteredItems.Selection.Select(0); item.Focus(); } } @@ -52,11 +53,9 @@ public SearchBox(IReadOnlyList viewModelActions, IReadOnlyList + this.FilteredItems.KeyDown += (sender, args) => { if (args.Key == Key.Up) { @@ -64,9 +63,24 @@ public SearchBox(IReadOnlyList viewModelActions, IReadOnlyList + { + if (args.Key == Key.Enter) { ChoseSelected(); } @@ -87,13 +101,13 @@ public SearchBox(IReadOnlyList viewModelActions, IReadOnlyList - { - if (args.Key is not Key.Escape or Key.Down or Key.Up or Key.Enter) - { - SearchBoxInput.Focus(); - } - }; + //this.FilteredItems.KeyDown += (sender, args) => + //{ + // if (args.Key is not Key.Escape or Key.Down or Key.Up or Key.Enter) + // { + // SearchBoxInput.Focus(); + // } + //}; }