Merge pull request #42840 from nextcloud/fix/dnd-files

fix(files): prevent dragging previews and appear as an external files DnD
This commit is contained in:
Ferdinand Thiessen 2024-01-17 18:28:30 +01:00 committed by GitHub
commit ef41104e3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 13 additions and 13 deletions

View file

@ -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

View file

@ -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()

View file

@ -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

4
dist/614-614.js vendored

File diff suppressed because one or more lines are too long

2
dist/614-614.js.map vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
dist/files-main.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long