Skip to content

Commit 2f35383

Browse files
committed
Expand flyout when pressing down key
1 parent a378633 commit 2f35383

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/Files.App.Controls/BreadcrumbBar/BreadcrumbBarItem.Events.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// Copyright (c) Files Community
22
// Licensed under the MIT License.
33

4+
using Microsoft.UI.Xaml.Input;
5+
using Windows.System;
6+
47
namespace Files.App.Controls
58
{
69
public partial class BreadcrumbBarItem
@@ -15,6 +18,18 @@ private void ItemChevronButton_Click(object sender, RoutedEventArgs e)
1518
FlyoutBase.ShowAttachedFlyout(_itemChevronButton);
1619
}
1720

21+
private void ItemChevronButton_PreviewKeyDown(object sender, KeyRoutedEventArgs e)
22+
{
23+
if (e.Key == VirtualKey.Down)
24+
FlyoutBase.ShowAttachedFlyout(_itemChevronButton);
25+
}
26+
27+
private void ItemContentButton_PreviewKeyDown(object sender, KeyRoutedEventArgs e)
28+
{
29+
if (e.Key == VirtualKey.Down)
30+
FlyoutBase.ShowAttachedFlyout(_itemChevronButton);
31+
}
32+
1833
private void ChevronDropDownMenuFlyout_Opening(object? sender, object e)
1934
{
2035
if (_ownerRef is null ||

src/Files.App.Controls/BreadcrumbBar/BreadcrumbBarItem.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ protected override void OnApplyTemplate()
4747
VisualStateManager.GoToState(this, "ChevronCollapsed", true);
4848

4949
_itemContentButton.Click += ItemContentButton_Click;
50+
_itemContentButton.PreviewKeyDown += ItemContentButton_PreviewKeyDown;
5051
_itemChevronButton.Click += ItemChevronButton_Click;
52+
_itemChevronButton.PreviewKeyDown += ItemChevronButton_PreviewKeyDown;
5153
_itemChevronDropDownMenuFlyout.Opening += ChevronDropDownMenuFlyout_Opening;
5254
_itemChevronDropDownMenuFlyout.Opened += ChevronDropDownMenuFlyout_Opened;
5355
_itemChevronDropDownMenuFlyout.Closed += ChevronDropDownMenuFlyout_Closed;

0 commit comments

Comments
 (0)