Skip to content

Commit adb6e79

Browse files
committed
More focus improvements
1 parent 9578162 commit adb6e79

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Files.App/UserControls/NavigationToolbar.xaml.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ private async void Omnibar_QuerySubmitted(Omnibar sender, OmnibarQuerySubmittedE
260260
if (Omnibar.CurrentSelectedMode == OmnibarPathMode)
261261
{
262262
await ViewModel.HandleItemNavigationAsync(args.Text);
263+
(MainPageViewModel.SelectedTabItem?.TabItemContent as Control)?.Focus(FocusState.Programmatic);
263264
}
264265
else if (Omnibar.CurrentSelectedMode == OmnibarCommandPaletteMode)
265266
{
@@ -294,8 +295,7 @@ await DialogDisplayHelper.ShowDialogAsync(Strings.CommandNotExecutable.GetLocali
294295
}
295296
}
296297

297-
ViewModel.OmnibarCurrentSelectedMode = OmnibarPathMode;
298-
ViewModel.OmnibarCommandPaletteModeText = string.Empty;
298+
(MainPageViewModel.SelectedTabItem?.TabItemContent as Control)?.Focus(FocusState.Programmatic);
299299
}
300300
else if (Omnibar.CurrentSelectedMode == OmnibarSearchMode)
301301
{
@@ -423,7 +423,10 @@ private void Omnibar_LostFocus(object sender, RoutedEventArgs e)
423423
private void Omnibar_PreviewKeyDown(object sender, KeyRoutedEventArgs e)
424424
{
425425
if (e.Key is VirtualKey.Escape)
426+
{
426427
Omnibar.IsFocused = false;
428+
(MainPageViewModel.SelectedTabItem?.TabItemContent as Control)?.Focus(FocusState.Programmatic);
429+
}
427430
}
428431
}
429432
}

0 commit comments

Comments
 (0)