Skip to content

Commit b4fcfb5

Browse files
authored
Feature: Added support for opening the breadcrumb dropdown via keyboard navigation (#16092)
1 parent 8f792f4 commit b4fcfb5

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

src/Files.App/UserControls/PathBreadcrumb.xaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@
8989
Background="Transparent"
9090
BorderBrush="Transparent"
9191
CornerRadius="0,4,4,0"
92-
DataContextChanged="PathItemSeparator_DataContextChanged">
92+
DataContextChanged="PathItemSeparator_DataContextChanged"
93+
IsTabStop="False">
9394
<Button.Flyout>
9495
<MenuFlyout
9596
x:Name="ExpandMenuFlyout"
@@ -133,6 +134,7 @@
133134
IsItemClickEnabled="True"
134135
ItemTemplateSelector="{StaticResource PathBreadcrumbItemSelector}"
135136
ItemsSource="{x:Bind ViewModel.PathComponents, Mode=OneWay}"
137+
KeyDown="PathBoxItem_KeyDown"
136138
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
137139
ScrollViewer.HorizontalScrollMode="Enabled"
138140
ScrollViewer.VerticalScrollBarVisibility="Disabled"

src/Files.App/UserControls/PathBreadcrumb.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,10 @@ private void PathBoxItem_PointerPressed(object sender, PointerRoutedEventArgs e)
4949
{
5050
ViewModel.PathBoxItem_PointerPressed(sender, e);
5151
}
52+
53+
private void PathBoxItem_KeyDown(object sender, KeyRoutedEventArgs e)
54+
{
55+
ViewModel.PathBoxItem_KeyDown(sender, e);
56+
}
5257
}
5358
}

src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,17 @@ await MainWindow.Instance.DispatcherQueue.EnqueueOrInvokeAsync(async () =>
537537
});
538538
}
539539

540+
public void PathBoxItem_KeyDown(object sender, KeyRoutedEventArgs e)
541+
{
542+
if (e.Key == Windows.System.VirtualKey.Down)
543+
{
544+
var item = e.OriginalSource as ListViewItem;
545+
var button = item?.FindDescendant<Button>();
546+
button?.Flyout.ShowAt(button);
547+
e.Handled = true;
548+
}
549+
}
550+
540551
public void OpenCommandPalette()
541552
{
542553
PathText = ">";

0 commit comments

Comments
 (0)