mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
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:
parent
5de3028f66
commit
3f77b543e3
3 changed files with 4 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue