aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2024-01-16 12:10:27 +0100
committernextcloud-command <nextcloud-command@users.noreply.github.com>2024-01-18 08:09:34 +0000
commit1f8e3724b84b6dedab383994ee122b333d0b4414 (patch)
tree529b47440c95464b7a30b2eb59e69014784a55eb /apps/files
parent0b9e2fa4bc7327b72ce5554c1663a64aa6467afd (diff)
downloadnextcloud-server-1f8e3724b84b6dedab383994ee122b333d0b4414.tar.gz
nextcloud-server-1f8e3724b84b6dedab383994ee122b333d0b4414.zip
fix(files): prevent dragging previews and appear as an external files DnD
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/src/components/DragAndDropNotice.vue2
-rw-r--r--apps/files/src/components/FileEntry.vue5
-rw-r--r--apps/files/src/components/FilesListVirtual.vue1
3 files changed, 4 insertions, 4 deletions
diff --git a/apps/files/src/components/DragAndDropNotice.vue b/apps/files/src/components/DragAndDropNotice.vue
index df03713601d..22de0f662de 100644
--- a/apps/files/src/components/DragAndDropNotice.vue
+++ b/apps/files/src/components/DragAndDropNotice.vue
@@ -115,8 +115,6 @@ export default defineComponent({
event.preventDefault()
const isForeignFile = event.dataTransfer?.types.includes('Files')
-
- logger.debug('Drag over DragAndDropNotice', { isForeignFile, event })
if (isForeignFile) {
// Only handle uploading of outside files (not Nextcloud files)
this.dragover = true
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue
index 5e5476b08f7..de598657ac7 100644
--- a/apps/files/src/components/FileEntry.vue
+++ b/apps/files/src/components/FileEntry.vue
@@ -466,7 +466,10 @@ export default defineComponent({
return
}
- logger.debug('Drag started')
+ logger.debug('Drag started', { event })
+
+ // Make sure that we're not dragging a file like the preview
+ event.dataTransfer?.clearData?.()
// Reset any renaming
this.renamingStore.$reset()
diff --git a/apps/files/src/components/FilesListVirtual.vue b/apps/files/src/components/FilesListVirtual.vue
index 6a075a27b4e..ed0096e9792 100644
--- a/apps/files/src/components/FilesListVirtual.vue
+++ b/apps/files/src/components/FilesListVirtual.vue
@@ -266,7 +266,6 @@ export default defineComponent({
onDragOver(event: DragEvent) {
// Detect if we're only dragging existing files or not
const isForeignFile = event.dataTransfer?.types.includes('Files')
-
if (isForeignFile) {
// Only handle uploading of existing Nextcloud files
// See DragAndDropNotice for handling of foreign files