Skip to content

Commit 2634ee8

Browse files
committed
Code Quality: Fixed issue where Omnibar sometimes stole focus
1 parent 78b229e commit 2634ee8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ public async void MultitaskingControl_CurrentInstanceChanged(object? sender, Cur
157157
e.CurrentInstance.ContentChanged += TabItemContent_ContentChanged;
158158

159159
await NavigationHelpers.UpdateInstancePropertiesAsync(navArgs);
160+
161+
// 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);
160163
}
161164

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

0 commit comments

Comments
 (0)