Skip to content

Commit bb226b0

Browse files
committed
Remove janky code for switching focus to listbox search
1 parent f054cd9 commit bb226b0

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

src/UI/Windows/BigListBox.cs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,7 @@ public BigListBox(string prompt,
8888
SelectedItem = 0
8989
};
9090
listView.SetSource(new ObservableCollection<string>(ErrorStringArray));
91-
92-
this.listView.KeyDown += this.ListView_KeyPress;
93-
91+
9492
this.listView.MouseClick += this.ListView_MouseClick;
9593

9694
this.collection = this.BuildList(this.GetInitialSource()).ToList();
@@ -223,21 +221,7 @@ private void ListView_MouseClick(object? sender, MouseEventArgs obj)
223221
this.Accept();
224222
}
225223
}
226-
227-
private void ListView_KeyPress(object? sender, Key key)
228-
{
229-
// if user types in some text change the focus to the text box to enable searching
230-
var c = (char)key;
231-
232-
// backspace or letter/numbers
233-
if (key == Key.Backspace || char.IsLetterOrDigit(c))
234-
{
235-
this.searchBox?.FocusDeepest(NavigationDirection.Forward, TabBehavior.TabStop);
236-
this.searchBox?.NewKeyDownEvent(key);
237-
key.Handled = true;
238-
}
239-
}
240-
224+
241225
private bool Timer()
242226
{
243227
if (this.changes && DateTime.Now.Subtract(this.lastKeypress) > TimeSpan.FromMilliseconds(100))

0 commit comments

Comments
 (0)