Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(files): prevent dragging previews and appear as an external files…
… DnD

Signed-off-by: John Molakvoæ <[email protected]>
  • Loading branch information
skjnldsv authored and susnux committed Jan 17, 2024
commit 3f77b543e3ee55177f87ca845d31bb7d2776d467
2 changes: 0 additions & 2 deletions apps/files/src/components/DragAndDropNotice.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion apps/files/src/components/FileEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion apps/files/src/components/FilesListVirtual.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down