File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/Files.App/UserControls Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -317,12 +317,17 @@ await DialogDisplayHelper.ShowDialogAsync(Strings.InvalidCommand.GetLocalizedRes
317317 else if ( mode == OmnibarSearchMode )
318318 {
319319 var shellPage = Ioc . Default . GetRequiredService < IContentPageContext > ( ) . ShellPage ;
320+
320321 if ( args . Item is SuggestionModel item && ! string . IsNullOrWhiteSpace ( item . ItemPath ) && shellPage is not null )
321322 await NavigationHelpers . OpenPath ( item . ItemPath , shellPage ) ;
322323 else
323324 {
324- ContentPageContext . ShellPage ? . SubmitSearch ( args . Text ) ;
325- ViewModel . SaveSearchQueryToList ( args . Text ) ;
325+ var searchQuery = args . Item is SuggestionModel x && ! string . IsNullOrWhiteSpace ( x . Name )
326+ ? x . Name
327+ : args . Text ;
328+
329+ shellPage ? . SubmitSearch ( searchQuery ) ; // use the resolved shellPage for consistency
330+ ViewModel . SaveSearchQueryToList ( searchQuery ) ;
326331 }
327332 }
328333 }
You can’t perform that action at this time.
0 commit comments