Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/Files.App/Views/ShellPanesPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -638,12 +638,20 @@ private void Pane_Loaded(object sender, RoutedEventArgs e)
{
if (sender is UIElement element)
{
element.GettingFocus += Pane_GettingFocus;
element.GotFocus += Pane_GotFocus;
element.RightTapped += Pane_RightTapped;
element.PointerPressed += Pane_PointerPressed;
}
}

private void Pane_GettingFocus(UIElement sender, GettingFocusEventArgs args)
{
// Workaround for https://github.com/files-community/Files/issues/15397
if (args?.NewFocusedElement is not null && args.NewFocusedElement is not (ListViewItem or GridViewItem or ListView or GridView or TextBox))
args.TryCancel();
}

private void Pane_ContentChanged(object? sender, TabBarItemParameter e)
{
TabBarItemParameter = new()
Expand Down Expand Up @@ -754,6 +762,7 @@ public void Dispose()
{
pane.Loaded -= Pane_Loaded;
pane.ContentChanged -= Pane_ContentChanged;
pane.GettingFocus -= Pane_GettingFocus;
pane.GotFocus -= Pane_GotFocus;
pane.RightTapped -= Pane_RightTapped;
pane.PointerPressed -= Pane_PointerPressed;
Expand Down
Loading