Skip to content

Commit 1d78721

Browse files
authored
Fix focus cycle in column view when some settings change (#7484)
1 parent 476b03b commit 1d78721

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

src/Files/BaseLayout.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,6 @@ protected override async void OnNavigatedTo(NavigationEventArgs eventArgs)
486486
UpdateCollectionViewSource();
487487
FolderSettings.IsLayoutModeChanging = false;
488488

489-
ItemManipulationModel.FocusFileList(); // Set focus on layout specific file list control
490-
491489
SetSelectedItemsOnNavigation();
492490

493491
ItemContextMenuFlyout.Opening += ItemContextFlyout_Opening;
@@ -509,6 +507,10 @@ public void SetSelectedItemsOnNavigation()
509507
ItemManipulationModel.SetSelectedItems(liItemsToSelect);
510508
ItemManipulationModel.FocusSelectedItems();
511509
}
510+
else
511+
{
512+
ItemManipulationModel.FocusFileList(); // Set focus on layout specific file list control
513+
}
512514
}
513515
catch (Exception)
514516
{

src/Files/Behaviors/StickyHeaderBehavior.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ private bool AssignAnimation()
187187
}
188188

189189
var expressionClipAnimation = ExpressionFunctions.Max(-scrollPropSet.Translation.Y, 0);
190+
_contentClip.TopInset = (float)System.Math.Max(-_scrollViewer.VerticalOffset, 0);
190191
_contentClip.StartAnimation("TopInset", expressionClipAnimation);
191192

192193
return true;

src/Files/Views/ColumnShellPage.xaml.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -818,17 +818,17 @@ private void FilesystemViewModel_ItemLoadStatusChanged(object sender, ItemLoadSt
818818
break;
819819

820820
case ItemLoadStatusChangedEventArgs.ItemLoadStatus.InProgress:
821-
var browser = this.FindAscendant<ColumnViewBrowser>();
822-
NavToolbarViewModel.CanGoBack = browser.ParentShellPageInstance.CanNavigateBackward;
823-
NavToolbarViewModel.CanGoForward = browser.ParentShellPageInstance.CanNavigateForward;
821+
if (this.FindAscendant<ColumnViewBrowser>() is ColumnViewBrowser browser)
822+
{
823+
NavToolbarViewModel.CanGoBack = browser.ParentShellPageInstance.CanNavigateBackward;
824+
NavToolbarViewModel.CanGoForward = browser.ParentShellPageInstance.CanNavigateForward;
825+
}
824826
SetLoadingIndicatorForTabs(true);
825827
break;
826828

827829
case ItemLoadStatusChangedEventArgs.ItemLoadStatus.Complete:
828830
SetLoadingIndicatorForTabs(false);
829831
NavToolbarViewModel.CanRefresh = true;
830-
// Set focus to the file list to allow arrow navigation
831-
ContentPage?.ItemManipulationModel.FocusFileList();
832832
// Select previous directory
833833
if (!string.IsNullOrWhiteSpace(e.PreviousDirectory))
834834
{

src/Files/Views/ModernShellPage.xaml.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -976,8 +976,6 @@ private void FilesystemViewModel_ItemLoadStatusChanged(object sender, ItemLoadSt
976976
case ItemLoadStatusChangedEventArgs.ItemLoadStatus.Complete:
977977
NavToolbarViewModel.CanRefresh = true;
978978
SetLoadingIndicatorForTabs(false);
979-
// Set focus to the file list to allow arrow navigation
980-
ContentPage?.ItemManipulationModel.FocusFileList();
981979
// Select previous directory
982980
if (!InstanceViewModel.IsPageTypeSearchResults && !string.IsNullOrWhiteSpace(e.PreviousDirectory))
983981
{

0 commit comments

Comments
 (0)