Skip to content

Commit

Permalink
fix: hide drag overlay on mouse drag leave
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Lamas <[email protected]>
  • Loading branch information
pedrolamas committed Sep 19, 2024
1 parent 8e2c501 commit 2716370
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export default class App extends Mixins(StateMixin, FilesMixin, BrowserMixin) {
mounted () {
window.addEventListener('dragover', this.handleDragOver)
window.addEventListener('dragenter', this.handleDragEnter)
window.addEventListener('dragenter', this.handleDragOver)
window.addEventListener('dragleave', this.handleDragLeave)
window.addEventListener('drop', this.handleDrop)
window.addEventListener('keydown', this.handleKeyDown, false)
Expand Down Expand Up @@ -359,7 +359,7 @@ export default class App extends Mixins(StateMixin, FilesMixin, BrowserMixin) {
beforeDestroy () {
window.removeEventListener('dragover', this.handleDragOver)
window.removeEventListener('dragenter', this.handleDragEnter)
window.removeEventListener('dragenter', this.handleDragOver)
window.removeEventListener('dragleave', this.handleDragLeave)
window.removeEventListener('drop', this.handleDrop)
window.removeEventListener('keydown', this.handleKeyDown)
Expand Down Expand Up @@ -387,12 +387,6 @@ export default class App extends Mixins(StateMixin, FilesMixin, BrowserMixin) {
}
}
handleDragEnter (event: DragEvent) {
if (this.fileDropRoot) {
event.preventDefault()
}
}
handleDragLeave (event: DragEvent) {
if (this.fileDropRoot) {
event.preventDefault()
Expand Down
1 change: 1 addition & 0 deletions src/components/ui/AppDragOverlay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export default class AppDragOverlay extends Vue {
<style lang="scss" scoped>
.dragOverlay.v-overlay--active {
border: dashed 3px #616161;
pointer-events: none !important;
}
.dragOverlay :deep(.v-overlay__content) {
Expand Down

0 comments on commit 2716370

Please sign in to comment.