Skip to content

Commit

Permalink
fix(files): prevent dragging previews and appear as an external files…
Browse files Browse the repository at this point in the history
… DnD

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
  • Loading branch information
skjnldsv authored and nextcloud-command committed Jan 18, 2024
1 parent 0b9e2fa commit 1f8e372
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
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
4 changes: 2 additions & 2 deletions dist/614-614.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/614-614.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-unsupported-browser.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-unsupported-browser.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-main.js.map

Large diffs are not rendered by default.

0 comments on commit 1f8e372

Please sign in to comment.