diff --git a/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml b/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml index f8c15a5dfced..635d57b1ffc6 100644 --- a/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml +++ b/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml @@ -220,6 +220,7 @@ IsTabStop="True" ItemsSource="{x:Bind CollectionViewSource.View, Mode=OneWay}" Loaded="FileList_Loaded" + LosingFocus="FileList_LosingFocus" PreviewKeyDown="FileList_PreviewKeyDown" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollMode="Auto" diff --git a/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml.cs b/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml.cs index f00734cdb9c4..18da9d7225e7 100644 --- a/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml.cs +++ b/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml.cs @@ -876,5 +876,11 @@ private void SetToolTip(TextBlock textBlock) { ToolTipService.SetToolTip(textBlock, textBlock.IsTextTrimmed ? textBlock.Text : null); } + + private void FileList_LosingFocus(UIElement sender, LosingFocusEventArgs args) + { + // Fixes an issue where clicking an empty space would scroll to the top of the file list + args.TryCancel(); + } } }