Skip to content

Commit cf87b52

Browse files
committed
Moved lost focus event back to app
1 parent c69bcda commit cf87b52

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/Files.App.Controls/Omnibar/Omnibar.Events.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ private void Omnibar_SizeChanged(object sender, SizeChangedEventArgs e)
1616
_textBoxSuggestionsContainerBorder.Width = ActualWidth;
1717
}
1818

19-
private void Omnibar_LostFocus(object sender, RoutedEventArgs e)
20-
{
21-
// Reset to the default mode when Omnibar loses focus
22-
CurrentSelectedMode = Modes?.FirstOrDefault();
23-
}
24-
2519
private void AutoSuggestBox_GettingFocus(UIElement sender, GettingFocusEventArgs args)
2620
{
2721
if (args.OldFocusedElement is null)

src/Files.App.Controls/Omnibar/Omnibar.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ protected override void OnApplyTemplate()
7575
PopulateModes();
7676

7777
SizeChanged += Omnibar_SizeChanged;
78-
LostFocus += Omnibar_LostFocus;
7978
_textBox.GettingFocus += AutoSuggestBox_GettingFocus;
8079
_textBox.GotFocus += AutoSuggestBox_GotFocus;
8180
_textBox.LosingFocus += AutoSuggestBox_LosingFocus;

src/Files.App/UserControls/NavigationToolbar.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@
351351
x:Load="{x:Bind ViewModel.EnableOmnibar, Mode=OneWay}"
352352
CurrentSelectedModeName="{x:Bind ViewModel.OmnibarCurrentSelectedModeName, Mode=TwoWay}"
353353
IsFocused="{x:Bind ViewModel.IsOmnibarFocused, Mode=TwoWay}"
354+
LostFocus="Omnibar_LostFocus"
354355
ModeChanged="Omnibar_ModeChanged"
355356
PreviewKeyDown="Omnibar_PreviewKeyDown"
356357
QuerySubmitted="Omnibar_QuerySubmitted"

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,12 @@ private void Omnibar_ModeChanged(object sender, OmnibarModeChangedEventArgs e)
435435
ViewModel.OmnibarCommandPaletteModeText = string.Empty;
436436
}
437437

438+
private void Omnibar_LostFocus(object sender, RoutedEventArgs e)
439+
{
440+
// Reset to the default mode when Omnibar loses focus
441+
Omnibar.CurrentSelectedMode = Omnibar.Modes?.FirstOrDefault();
442+
}
443+
438444
private async void Omnibar_PreviewKeyDown(object sender, KeyRoutedEventArgs e)
439445
{
440446
if (e.Key is VirtualKey.Escape)

0 commit comments

Comments
 (0)