diff --git a/src/Files.App/ViewModels/ShellViewModel.cs b/src/Files.App/ViewModels/ShellViewModel.cs index 970916fa4f50..d81f0e86a2b8 100644 --- a/src/Files.App/ViewModels/ShellViewModel.cs +++ b/src/Files.App/ViewModels/ShellViewModel.cs @@ -59,6 +59,7 @@ public sealed partial class ShellViewModel : ObservableObject, IDisposable private readonly IStorageCacheService fileListCache = Ioc.Default.GetRequiredService(); private readonly IWindowsSecurityService WindowsSecurityService = Ioc.Default.GetRequiredService(); private readonly IStorageTrashBinService StorageTrashBinService = Ioc.Default.GetRequiredService(); + private readonly IContentPageContext ContentPageContext = Ioc.Default.GetRequiredService(); // Only used for Binding and ApplyFilesAndFoldersChangesAsync, don't manipulate on this! public BulkConcurrentObservableCollection FilesAndFolders { get; } @@ -873,6 +874,11 @@ await dispatcherQueue.EnqueueOrInvokeAsync(() => private Task RequestSelectionAsync(List itemsToSelect) { + // Don't notify if shell page is not the active pane (eg. Dual Pane) + // https://github.com/files-community/Files/issues/17427 + if (WorkingDirectory != ContentPageContext.ShellPage!.ShellViewModel.WorkingDirectory) + return Task.CompletedTask; + // Don't notify if there weren't listed items if (itemsToSelect is null || itemsToSelect.IsEmpty()) return Task.CompletedTask;