fix(files): prevent dragging previews and appear as an external files DnD

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ 2024-01-16 12:10:27 +01:00 committed by Ferdinand Thiessen
parent 5de3028f66
commit 3f77b543e3
3 changed files with 4 additions and 4 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