Skip to content

Commit 698cf5a

Browse files
committed
Code Quality: Added delay before focusing tabs content
1 parent c7d7f9f commit 698cf5a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ namespace Files.App.Views
2222
public sealed partial class MainPage : Page
2323
{
2424
private IGeneralSettingsService generalSettingsService { get; } = Ioc.Default.GetRequiredService<IGeneralSettingsService>();
25+
private readonly IContentPageContext ContentPageContext = Ioc.Default.GetRequiredService<IContentPageContext>();
2526
public IUserSettingsService UserSettingsService { get; }
2627
private readonly IWindowContext WindowContext = Ioc.Default.GetRequiredService<IWindowContext>();
2728
private readonly ICommandManager Commands = Ioc.Default.GetRequiredService<ICommandManager>();
@@ -159,7 +160,9 @@ public async void MultitaskingControl_CurrentInstanceChanged(object? sender, Cur
159160
await NavigationHelpers.UpdateInstancePropertiesAsync(navArgs);
160161

161162
// Focus the content of the selected tab item (this also avoids an issue where the Omnibar sometimes steals the focus)
162-
(ViewModel.SelectedTabItem?.TabItemContent as Control)?.Focus(FocusState.Programmatic);
163+
await Task.Delay(100);
164+
ContentPageContext.ShellPage!.PaneHolder.FocusActivePane();
165+
163166
}
164167

165168
private void PaneHolder_PropertyChanged(object? sender, PropertyChangedEventArgs e)

0 commit comments

Comments
 (0)