File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ namespace Files.App.Actions
99 internal sealed partial class NextTabAction : ObservableObject , IAction
1010 {
1111 private readonly IMultitaskingContext multitaskingContext ;
12+ private readonly IContentPageContext contentPageContext = Ioc . Default . GetRequiredService < IContentPageContext > ( ) ;
1213
1314 public string Label
1415 => Strings . NextTab . GetLocalizedResource ( ) ;
@@ -37,7 +38,7 @@ public async Task ExecuteAsync(object? parameter = null)
3738 await Task . Delay ( 500 ) ;
3839
3940 // Focus the content of the selected tab item (needed for keyboard navigation)
40- ( multitaskingContext . CurrentTabItem . TabItemContent as Control ) ? . Focus ( FocusState . Programmatic ) ;
41+ contentPageContext . ShellPage ! . PaneHolder . FocusActivePane ( ) ;
4142 }
4243
4344 private void MultitaskingContext_PropertyChanged ( object ? sender , PropertyChangedEventArgs e )
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ namespace Files.App.Actions
99 internal sealed partial class PreviousTabAction : ObservableObject , IAction
1010 {
1111 private readonly IMultitaskingContext multitaskingContext ;
12+ private readonly IContentPageContext contentPageContext = Ioc . Default . GetRequiredService < IContentPageContext > ( ) ;
1213
1314 public string Label
1415 => Strings . PreviousTab . GetLocalizedResource ( ) ;
@@ -40,7 +41,7 @@ public async Task ExecuteAsync(object? parameter = null)
4041 await Task . Delay ( 500 ) ;
4142
4243 // Focus the content of the selected tab item (needed for keyboard navigation)
43- ( multitaskingContext . CurrentTabItem . TabItemContent as Control ) ? . Focus ( FocusState . Programmatic ) ;
44+ contentPageContext . ShellPage ! . PaneHolder . FocusActivePane ( ) ;
4445 }
4546
4647 private void MultitaskingContext_PropertyChanged ( object ? sender , PropertyChangedEventArgs e )
Original file line number Diff line number Diff line change @@ -391,7 +391,7 @@ private async void ExecuteNavigateToNumberedTabKeyboardAcceleratorCommand(Keyboa
391391 await Task . Delay ( 500 ) ;
392392
393393 // Focus the content of the selected tab item (needed for keyboard navigation)
394- ( SelectedTabItem ? . TabItemContent as Control ) ? . Focus ( FocusState . Programmatic ) ;
394+ context . ShellPage ! . PaneHolder . FocusActivePane ( ) ;
395395 }
396396
397397 e . Handled = true ;
You can’t perform that action at this time.
0 commit comments