diff --git a/src/Files.App/Utils/Storage/Operations/FilesystemHelpers.cs b/src/Files.App/Utils/Storage/Operations/FilesystemHelpers.cs index 22274b571fc2..62cf8e732e1d 100644 --- a/src/Files.App/Utils/Storage/Operations/FilesystemHelpers.cs +++ b/src/Files.App/Utils/Storage/Operations/FilesystemHelpers.cs @@ -245,14 +245,14 @@ public async Task RestoreItemsFromTrashAsync(IEnumerable x.Item is ZipStorageFile || @@ -151,7 +153,8 @@ public async Task DragOverAsync(DragEventArgs e) else if (draggedItems.AreItemsInSameDrive(_associatedInstance.FilesystemViewModel.WorkingDirectory)) { e.DragUIOverride.Caption = string.Format("MoveToFolderCaptionText".GetLocalizedResource(), folderName); - e.AcceptedOperation = DataPackageOperation.Move; + // Some applications such as Edge can't raise the drop event by the Move flag (#14008), so we set the Copy flag as well. + e.AcceptedOperation = DataPackageOperation.Move | DataPackageOperation.Copy; } else { diff --git a/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs b/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs index fe29f8fc0487..29f235f519ed 100644 --- a/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs @@ -410,7 +410,8 @@ public async Task PathBoxItem_DragOver(object sender, DragEventArgs e) { e.DragUIOverride.IsCaptionVisible = true; e.DragUIOverride.Caption = string.Format("MoveToFolderCaptionText".GetLocalizedResource(), pathBoxItem.Title); - e.AcceptedOperation = DataPackageOperation.Move; + // Some applications such as Edge can't raise the drop event by the Move flag (#14008), so we set the Copy flag as well. + e.AcceptedOperation = DataPackageOperation.Move | DataPackageOperation.Copy; } deferral.Complete(); diff --git a/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs b/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs index 1a3702389164..3610e63ede67 100644 --- a/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs @@ -1130,7 +1130,8 @@ private async Task HandleLocationItemDragOverAsync(LocationItem locationItem, It if (locationItem.Path.StartsWith(Constants.UserEnvironmentPaths.RecycleBinPath, StringComparison.Ordinal)) { captionText = string.Format("MoveToFolderCaptionText".GetLocalizedResource(), locationItem.Text); - operationType = DataPackageOperation.Move; + // Some applications such as Edge can't raise the drop event by the Move flag (#14008), so we set the Copy flag as well. + operationType = DataPackageOperation.Move | DataPackageOperation.Copy; } else if (rawEvent.Modifiers.HasFlag(DragDropModifiers.Alt) || rawEvent.Modifiers.HasFlag(DragDropModifiers.Control | DragDropModifiers.Shift)) { @@ -1145,7 +1146,8 @@ private async Task HandleLocationItemDragOverAsync(LocationItem locationItem, It else if (rawEvent.Modifiers.HasFlag(DragDropModifiers.Shift)) { captionText = string.Format("MoveToFolderCaptionText".GetLocalizedResource(), locationItem.Text); - operationType = DataPackageOperation.Move; + // Some applications such as Edge can't raise the drop event by the Move flag (#14008), so we set the Copy flag as well. + operationType = DataPackageOperation.Move | DataPackageOperation.Copy; } else if (storageItems.Any(x => x.Item is ZipStorageFile || x.Item is ZipStorageFolder) || ZipStorageFolder.IsZipPath(locationItem.Path)) @@ -1156,7 +1158,8 @@ private async Task HandleLocationItemDragOverAsync(LocationItem locationItem, It else if (locationItem.IsDefaultLocation || storageItems.AreItemsInSameDrive(locationItem.Path)) { captionText = string.Format("MoveToFolderCaptionText".GetLocalizedResource(), locationItem.Text); - operationType = DataPackageOperation.Move; + // Some applications such as Edge can't raise the drop event by the Move flag (#14008), so we set the Copy flag as well. + operationType = DataPackageOperation.Move | DataPackageOperation.Copy; } else { @@ -1204,12 +1207,14 @@ private async Task HandleDriveItemDragOverAsync(DriveItem driveItem, ItemDragOve else if (args.RawEvent.Modifiers.HasFlag(DragDropModifiers.Shift)) { captionText = string.Format("MoveToFolderCaptionText".GetLocalizedResource(), driveItem.Text); - operationType = DataPackageOperation.Move; + // Some applications such as Edge can't raise the drop event by the Move flag (#14008), so we set the Copy flag as well. + operationType = DataPackageOperation.Move | DataPackageOperation.Copy; } else if (storageItems.AreItemsInSameDrive(driveItem.Path)) { captionText = string.Format("MoveToFolderCaptionText".GetLocalizedResource(), driveItem.Text); - operationType = DataPackageOperation.Move; + // Some applications such as Edge can't raise the drop event by the Move flag (#14008), so we set the Copy flag as well. + operationType = DataPackageOperation.Move | DataPackageOperation.Copy; } else { diff --git a/src/Files.App/Views/Layouts/BaseLayoutPage.cs b/src/Files.App/Views/Layouts/BaseLayoutPage.cs index 094ab202261f..7bbd63700280 100644 --- a/src/Files.App/Views/Layouts/BaseLayoutPage.cs +++ b/src/Files.App/Views/Layouts/BaseLayoutPage.cs @@ -1052,7 +1052,8 @@ private async void Item_DragOver(object sender, DragEventArgs e) else if (e.Modifiers.HasFlag(DragDropModifiers.Shift)) { e.DragUIOverride.Caption = string.Format("MoveToFolderCaptionText".GetLocalizedResource(), item.Name); - e.AcceptedOperation = DataPackageOperation.Move; + // Some applications such as Edge can't raise the drop event by the Move flag (#14008), so we set the Copy flag as well. + e.AcceptedOperation = DataPackageOperation.Move | DataPackageOperation.Copy; } else if (draggedItems.Any(x => x.Item is ZipStorageFile || x.Item is ZipStorageFolder) || ZipStorageFolder.IsZipPath(item.ItemPath)) @@ -1063,7 +1064,8 @@ private async void Item_DragOver(object sender, DragEventArgs e) else if (draggedItems.AreItemsInSameDrive(item.ItemPath)) { e.DragUIOverride.Caption = string.Format("MoveToFolderCaptionText".GetLocalizedResource(), item.Name); - e.AcceptedOperation = DataPackageOperation.Move; + // Some applications such as Edge can't raise the drop event by the Move flag (#14008), so we set the Copy flag as well. + e.AcceptedOperation = DataPackageOperation.Move | DataPackageOperation.Copy; } else {