Skip to content

Commit 311b380

Browse files
Fix: Fixed an issue where clicking an empty space would scroll to the top of the file list (#13157)
1 parent 0988113 commit 311b380

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@
220220
IsTabStop="True"
221221
ItemsSource="{x:Bind CollectionViewSource.View, Mode=OneWay}"
222222
Loaded="FileList_Loaded"
223+
LosingFocus="FileList_LosingFocus"
223224
PreviewKeyDown="FileList_PreviewKeyDown"
224225
ScrollViewer.HorizontalScrollBarVisibility="Auto"
225226
ScrollViewer.HorizontalScrollMode="Auto"

src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,5 +876,11 @@ private void SetToolTip(TextBlock textBlock)
876876
{
877877
ToolTipService.SetToolTip(textBlock, textBlock.IsTextTrimmed ? textBlock.Text : null);
878878
}
879+
880+
private void FileList_LosingFocus(UIElement sender, LosingFocusEventArgs args)
881+
{
882+
// Fixes an issue where clicking an empty space would scroll to the top of the file list
883+
args.TryCancel();
884+
}
879885
}
880886
}

0 commit comments

Comments
 (0)