Skip to content

Commit b717ca3

Browse files
committed
Fix: Fixed issue with clearing selection via touch
1 parent 3c5452c commit b717ca3

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/Files.App/Views/Layouts/DetailsLayoutPage.xaml.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,13 @@ private async void FileList_ItemTapped(object sender, TappedRoutedEventArgs e)
567567
await CommitRenameAsync(textBox);
568568
}
569569
}
570+
else
571+
{
572+
// Clear selection when clicking empty area via touch
573+
// https://github.com/files-community/Files/issues/15051
574+
if (e.PointerDeviceType == PointerDeviceType.Touch)
575+
ItemManipulationModel.ClearSelection();
576+
}
570577
return;
571578
}
572579

src/Files.App/Views/Layouts/GridLayoutPage.xaml.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,12 @@ private async void FileList_ItemTapped(object sender, TappedRoutedEventArgs e)
610610

611611
var item = (e.OriginalSource as FrameworkElement)?.DataContext as ListedItem;
612612
if (item is null)
613-
return;
613+
{
614+
// Clear selection when clicking empty area via touch
615+
// https://github.com/files-community/Files/issues/15051
616+
if (e.PointerDeviceType == PointerDeviceType.Touch)
617+
ItemManipulationModel.ClearSelection();
618+
}
614619

615620
// Skip code if the control or shift key is pressed or if the user is using multiselect
616621
if (ctrlPressed ||

0 commit comments

Comments
 (0)