Skip to content

Commit 5a7f153

Browse files
authored
Fix: Fixed issue preventing file selection via keyboard (#17299)
1 parent c4f21f2 commit 5a7f153

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,9 @@ protected override async void FileList_PreviewKeyDown(object sender, KeyRoutedEv
493493
}
494494
else if (e.Key == VirtualKey.Down)
495495
{
496-
if (isHeaderFocused)
496+
// Focus the first item in the file list if Header header has focus,
497+
// or if there is only one item in the file list (#13774)
498+
if (isHeaderFocused || FileList.Items.Count == 1)
497499
{
498500
var selectIndex = FileList.SelectedIndex < 0 ? 0 : FileList.SelectedIndex;
499501
if (FileList.ContainerFromIndex(selectIndex) is ListViewItem item)

0 commit comments

Comments
 (0)