Skip to content

Commit cd0f141

Browse files
committed
Revert to path mode on lost focus
1 parent 8ae1270 commit cd0f141

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/Files.App/UserControls/NavigationToolbar.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@
324324
CurrentSelectedMode="{x:Bind ViewModel.OmnibarCurrentSelectedMode, Mode=TwoWay}"
325325
CurrentSelectedModeName="{x:Bind ViewModel.OmnibarCurrentSelectedModeName, Mode=TwoWay}"
326326
IsFocused="{x:Bind ViewModel.IsOmnibarFocused, Mode=TwoWay}"
327+
LostFocus="Omnibar_LostFocus"
327328
QuerySubmitted="Omnibar_QuerySubmitted"
328329
TextChanged="Omnibar_TextChanged">
329330

@@ -358,7 +359,7 @@
358359
AutomationProperties.AccessibilityView="Content"
359360
AutomationProperties.Name="{x:Bind Title, Mode=OneWay}"
360361
ChevronToolTip="{helpers:ResourceString Name=BreadcrumbBarChevronButtonToolTip}"
361-
Content="{x:Bind Title, Mode=OneWay}"/>
362+
Content="{x:Bind Title, Mode=OneWay}" />
362363
</DataTemplate>
363364
</controls:BreadcrumbBar.ItemTemplate>
364365
</controls:BreadcrumbBar>

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,5 +397,14 @@ private void BreadcrumbBar_ItemDropDownFlyoutClosed(object sender, BreadcrumbBar
397397
// Clear the flyout items to save memory
398398
e.Flyout.Items.Clear();
399399
}
400+
401+
private void Omnibar_LostFocus(object sender, RoutedEventArgs e)
402+
{
403+
if (ViewModel.OmnibarCurrentSelectedMode == OmnibarCommandPaletteMode)
404+
{
405+
ViewModel.OmnibarCurrentSelectedMode = OmnibarPathMode;
406+
ViewModel.OmnibarCommandPaletteModeText = string.Empty;
407+
}
408+
}
400409
}
401410
}

0 commit comments

Comments
 (0)