Skip to content

Commit 979e8dd

Browse files
committed
comments
1 parent 2e829a1 commit 979e8dd

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Files.App/Actions/Show/ToggleFilterHeaderAction.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

src/Files.App/Views/MainPage.xaml.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)