Skip to content

Commit a378633

Browse files
committed
Focus path bar when using Edit Path action
1 parent ee54ec0 commit a378633

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Files.App/ViewModels/UserControls/NavigationToolbarViewModel.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@
99
using Microsoft.UI.Xaml.Controls;
1010
using Microsoft.UI.Xaml.Controls.Primitives;
1111
using Microsoft.UI.Xaml.Input;
12+
using Microsoft.UI.Xaml.Media.Imaging;
1213
using System.IO;
1314
using System.Windows.Input;
1415
using Windows.AI.Actions;
15-
using Windows.AI.Actions.Hosting;
1616
using Windows.ApplicationModel.DataTransfer;
17-
using Microsoft.Windows.ApplicationModel.Resources;
1817
using Windows.UI.Text;
19-
using Microsoft.UI.Xaml.Media.Imaging;
2018

2119
namespace Files.App.ViewModels.UserControls
2220
{
@@ -254,7 +252,7 @@ public bool IsOmnibarFocused
254252
_ = PopulateOmnibarSuggestionsForPathMode();
255253
break;
256254
case OmnibarPaletteModeName:
257-
PopulateOmnibarSuggestionsForCommandPaletteMode();
255+
PopulateOmnibarSuggestionsForCommandPaletteMode();
258256
break;
259257
case OmnibarSearchModeName:
260258
break;
@@ -816,6 +814,10 @@ public void SwitchToSearchMode()
816814
public void SwitchToPathMode()
817815
{
818816
OmnibarCurrentSelectedModeName = OmnibarPathModeName;
817+
818+
var omnibar = AddressToolbar?.FindDescendant("Omnibar") as Omnibar;
819+
omnibar?.Focus(FocusState.Programmatic);
820+
omnibar.IsFocused = true;
819821
}
820822

821823
public void UpdateAdditionalActions()

0 commit comments

Comments
 (0)