Skip to content

Commit

Permalink
Fix: Fixed an issue where clicking an empty space would scroll to the…
Browse files Browse the repository at this point in the history
… top of the file list (files-community#13157)
  • Loading branch information
ferrariofilippo authored Aug 8, 2023
1 parent 0988113 commit 311b380
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}

0 comments on commit 311b380

Please sign in to comment.