Skip to content

Commit 8acc5e1

Browse files
el-evyaira2
authored andcommitted
fix
1 parent f8c728b commit 8acc5e1

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
@@ -527,13 +527,13 @@ await MainWindow.Instance.DispatcherQueue.EnqueueOrInvokeAsync(async () =>
527527

528528
public void PathBoxItem_PreviewKeyDown(object sender, KeyRoutedEventArgs e)
529529
{
530-
if (e.Key == Windows.System.VirtualKey.Down)
530+
if (e.Key is Windows.System.VirtualKey.Down)
531531
{
532532
var item = e.OriginalSource as ListViewItem;
533533
var button = item?.FindDescendant<Button>();
534534
button?.Flyout.ShowAt(button);
535535
e.Handled = true;
536-
} else if (e.Key == Windows.System.VirtualKey.Space || e.Key == Windows.System.VirtualKey.Enter)
536+
} else if (e.Key is Windows.System.VirtualKey.Space or Windows.System.VirtualKey.Enter)
537537
{
538538
var item = e.OriginalSource as ListViewItem;
539539
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
@@ -235,13 +235,20 @@ private async Task OnPreviewKeyDownAsync(KeyRoutedEventArgs e)
235235
default:
236236
var currentModifiers = HotKeyHelpers.GetCurrentKeyModifiers();
237237
HotKey hotKey = new((Keys)e.Key, currentModifiers);
238+
var source = (DependencyObject)e.OriginalSource;
238239

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

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

0 commit comments

Comments
 (0)