Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable28] fix(files): prevent dragging previews and appear as an external files DnD #42895

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.