File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,10 @@ public Task ExecuteAsync(object? parameter = null)
3232 if ( IsOn )
3333 ContentPageContext . ShellPage ! . ShellViewModel . InvokeFocusFilterHeader ( ) ;
3434 else
35+ {
36+ // Clear the filter query when the header is hidden
3537 ContentPageContext . ShellPage ! . ShellViewModel . FilesAndFoldersFilter = string . Empty ;
38+ }
3639
3740 return Task . CompletedTask ;
3841 }
Original file line number Diff line number Diff line change @@ -216,8 +216,10 @@ private async Task OnPreviewKeyDownAsync(KeyRoutedEventArgs e)
216216 if ( source ? . FindAscendantOrSelf < TextBox > ( ) is not null )
217217 break ;
218218
219- // Prevent the back key from executing a command if the filter header is not empty
220- if ( e . Key is VirtualKey . Back && UserSettingsService . FoldersSettingsService . KeyboardTypingBehavior == KeyboardTypingBehavior . FilterItems && ! string . IsNullOrEmpty ( SidebarAdaptiveViewModel . PaneHolder ? . ActivePaneOrColumn ! . ShellViewModel . FilesAndFoldersFilter ) )
219+ // Prevent the back key from executing a command if the keyboard typing behavior is set to filter items and a filter is currently applied.
220+ if ( e . Key is VirtualKey . Back &&
221+ UserSettingsService . FoldersSettingsService . KeyboardTypingBehavior == KeyboardTypingBehavior . FilterItems &&
222+ ! string . IsNullOrEmpty ( SidebarAdaptiveViewModel . PaneHolder ? . ActivePaneOrColumn ! . ShellViewModel . FilesAndFoldersFilter ) )
221223 break ;
222224
223225 // Execute command for hotkey
You can’t perform that action at this time.
0 commit comments