Skip to content

Commit 93a488b

Browse files
committed
fix
1 parent 485dbac commit 93a488b

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,13 +553,13 @@ await MainWindow.Instance.DispatcherQueue.EnqueueOrInvokeAsync(async () =>
553553

554554
public void PathBoxItem_PreviewKeyDown(object sender, KeyRoutedEventArgs e)
555555
{
556-
if (e.Key == Windows.System.VirtualKey.Down)
556+
if (e.Key is Windows.System.VirtualKey.Down)
557557
{
558558
var item = e.OriginalSource as ListViewItem;
559559
var button = item?.FindDescendant<Button>();
560560
button?.Flyout.ShowAt(button);
561561
e.Handled = true;
562-
} else if (e.Key == Windows.System.VirtualKey.Space || e.Key == Windows.System.VirtualKey.Enter)
562+
} else if (e.Key is Windows.System.VirtualKey.Space or Windows.System.VirtualKey.Enter)
563563
{
564564
var item = e.OriginalSource as ListViewItem;
565565
var path = (item?.Content as PathBoxItem)?.Path;

src/Files.App/Views/MainPage.xaml.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,20 @@ private async Task OnPreviewKeyDownAsync(KeyRoutedEventArgs e)
234234
default:
235235
var currentModifiers = HotKeyHelpers.GetCurrentKeyModifiers();
236236
HotKey hotKey = new((Keys)e.Key, currentModifiers);
237+
var source = (DependencyObject)e.OriginalSource;
237238

238239
// A textbox takes precedence over certain hotkeys.
239-
if (e.OriginalSource is DependencyObject source && source.FindAscendantOrSelf<TextBox>() is not null)
240+
if (source.FindAscendantOrSelf<TextBox>() is not null)
240241
break;
241242

242243
// Execute command for hotkey
243244
var command = Commands[hotKey];
245+
246+
if (command.Code is CommandCodes.OpenItem && source.FindAscendantOrSelf<PathBreadcrumb>() is not null)
247+
{
248+
break;
249+
}
250+
244251
if (command.Code is not CommandCodes.None && keyReleased)
245252
{
246253
keyReleased = false;

0 commit comments

Comments
 (0)