Skip to content

Commit fad37df

Browse files
committed
Fixed 'When breadcrumb flyout is open, clicking on Command mode switches to path mode'
1 parent 164a665 commit fad37df

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ private void AutoSuggestBox_LosingFocus(UIElement sender, LosingFocusEventArgs a
3232
args.TryCancel();
3333
return;
3434
}
35+
else
36+
{
37+
// Reset to the default mode when Omnibar loses focus
38+
CurrentSelectedMode = Modes?.FirstOrDefault();
39+
}
3540
}
3641

3742
private void AutoSuggestBox_GotFocus(object sender, RoutedEventArgs e)

src/Files.App/UserControls/NavigationToolbar.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@
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"
355354
ModeChanged="Omnibar_ModeChanged"
356355
PreviewKeyDown="Omnibar_PreviewKeyDown"
357356
QuerySubmitted="Omnibar_QuerySubmitted"

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -428,12 +428,6 @@ private void BreadcrumbBar_ItemDropDownFlyoutClosed(object sender, BreadcrumbBar
428428
e.Flyout.Items.Clear();
429429
}
430430

431-
private void Omnibar_LostFocus(object sender, RoutedEventArgs e)
432-
{
433-
// Reset to the default mode when Omnibar loses focus
434-
Omnibar.CurrentSelectedMode = Omnibar.Modes?.FirstOrDefault();
435-
}
436-
437431
private void Omnibar_ModeChanged(object sender, OmnibarModeChangedEventArgs e)
438432
{
439433
// Reset the command palette text when switching modes

0 commit comments

Comments
 (0)