Skip to content

Fix: Fixed issue with clearing selection via touch #17441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Files.App/Views/Layouts/ColumnLayoutPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,11 @@ private async void FileList_ItemTapped(object sender, TappedRoutedEventArgs e)
else
{
CloseFolder();

// Clear selection when clicking empty area via touch
// https://github.com/files-community/Files/issues/15051
if (e.PointerDeviceType == PointerDeviceType.Touch)
ItemManipulationModel.ClearSelection();
}
}

Expand Down
7 changes: 7 additions & 0 deletions src/Files.App/Views/Layouts/DetailsLayoutPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,13 @@ private async void FileList_ItemTapped(object sender, TappedRoutedEventArgs e)
await CommitRenameAsync(textBox);
}
}
else
{
// Clear selection when clicking empty area via touch
// https://github.com/files-community/Files/issues/15051
if (e.PointerDeviceType == PointerDeviceType.Touch)
ItemManipulationModel.ClearSelection();
}
return;
}

Expand Down
7 changes: 7 additions & 0 deletions src/Files.App/Views/Layouts/GridLayoutPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,14 @@ private async void FileList_ItemTapped(object sender, TappedRoutedEventArgs e)

var item = (e.OriginalSource as FrameworkElement)?.DataContext as ListedItem;
if (item is null)
{
// Clear selection when clicking empty area via touch
// https://github.com/files-community/Files/issues/15051
if (e.PointerDeviceType == PointerDeviceType.Touch)
ItemManipulationModel.ClearSelection();

return;
}

// Skip code if the control or shift key is pressed or if the user is using multiselect
if (ctrlPressed ||
Expand Down
Loading