@@ -602,16 +602,26 @@ public void SwitchToCommandPaletteMode()
602
602
OmnibarCurrentSelectedModeName = OmnibarPaletteModeName ;
603
603
}
604
604
605
- public void SwitchToSearchMode ( )
605
+ public async Task SwitchToSearchMode ( )
606
606
{
607
+ // If the Omnibar is already focused such as when the user initiates a search via the Command Palette,
608
+ // add a short delay to allow the Command Palette to fully close before switching modes.
609
+ var omnibar = AddressToolbar ? . FindDescendant ( "Omnibar" ) as Omnibar ;
610
+ if ( omnibar is not null && omnibar . IsFocused )
611
+ await Task . Delay ( 100 ) ;
612
+
607
613
OmnibarCurrentSelectedModeName = OmnibarSearchModeName ;
608
614
}
609
615
610
- public void SwitchToPathMode ( )
616
+ public async Task SwitchToPathMode ( )
611
617
{
612
- OmnibarCurrentSelectedModeName = OmnibarPathModeName ;
613
-
618
+ // If the Omnibar is already focused such as when the user initiates the Edit Path action via the
619
+ // Command Palette, add a short delay to allow the Command Palette to fully close before switching modes.
614
620
var omnibar = AddressToolbar ? . FindDescendant ( "Omnibar" ) as Omnibar ;
621
+ if ( omnibar is not null && omnibar . IsFocused )
622
+ await Task . Delay ( 100 ) ;
623
+
624
+ OmnibarCurrentSelectedModeName = OmnibarPathModeName ;
615
625
omnibar ? . Focus ( FocusState . Programmatic ) ;
616
626
omnibar . IsFocused = true ;
617
627
}
@@ -997,8 +1007,7 @@ await Task.Run(() =>
997
1007
HotKeys = command . HotKeys ,
998
1008
SearchText = OmnibarCommandPaletteModeText ,
999
1009
} )
1000
- . Where ( item => item . Text != Commands . OpenCommandPalette . Description . ToString ( )
1001
- && item . Text != Commands . EditPath . Description . ToString ( ) ) ;
1010
+ . Where ( item => item . Text != Commands . OpenCommandPalette . Description . ToString ( ) ) ;
1002
1011
} ) ;
1003
1012
1004
1013
newSuggestions . AddRange ( suggestionItems ) ;
0 commit comments