Browse Source

Merge pull request #3574 from nextcloud/ignore-drag-and-drop-events-if-files-are-not-involved

Ignore drag and drop events if files are not involved
pull/3579/head
Joas Schilling 6 years ago
committed by GitHub
parent
commit
ff8213dd2a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      src/components/ChatView.vue

12
src/components/ChatView.vue

@ -21,7 +21,7 @@
<template>
<div
class="chatView"
@dragover.prevent="isDraggingOver = true"
@dragover.prevent="handleDragOver"
@dragleave.prevent="isDraggingOver = false"
@drop.prevent="handleDropFiles">
<transition name="slide" mode="out-in">
@ -100,7 +100,17 @@ export default {
methods: {
handleDragOver(event) {
if (event.dataTransfer.types.includes('Files')) {
this.isDraggingOver = true
}
},
handleDropFiles(event) {
if (!this.isDraggingOver) {
return
}
// Restore non dragover state
this.isDraggingOver = false
// Stop the executin if the user is a guest

Loading…
Cancel
Save