Fix: Limit global drag-drop to events with files (#4767)

This commit is contained in:
shamoon
2023-12-02 07:47:57 -08:00
committed by GitHub
parent 20f27fe32f
commit 4ca1503beb
2 changed files with 12 additions and 5 deletions

View File

@@ -38,8 +38,9 @@ export class FileDropComponent {
@ViewChild('ngxFileDrop') ngxFileDrop: NgxFileDropComponent
@HostListener('dragover', ['$event ']) onDragOver(event: DragEvent) {
if (!this.dragDropEnabled) return
@HostListener('dragover', ['$event']) onDragOver(event: DragEvent) {
if (!this.dragDropEnabled || !event.dataTransfer?.types?.includes('Files'))
return
event.preventDefault()
event.stopImmediatePropagation()
this.settings.globalDropzoneActive = true