As the others stated you need to call event.preventDefault()
and event.stopPropagation()
on the (dragover)
event to make your container a valid dropzone.
I've written a highly customizable Angular component which implements the correct Drag'n'Drop behavior so I don't need to copy it over and over again which returns a list of the dropped files as an output event.
This can be found here.
After you imported the module you have access to the component:
<ngx-dropzone [multiple]="false" [maxFileSize]="2000"></ngx-dropzone>
You have some options to set and it comes with a decent default styling (screenshots can be found in the GitHub repo). If you want to, you can even take your own div
container with your custom styles and hover effects and put it in the dropzone. Details on this can be found in the API description.
<ngx-dropzone [customContent]="customDropzone" (filesAdded)="onFilesDropped($event)">
<ng-template #customDropzone>
<div class="custom-dropzone">
This is my custom content
</div>
</ng-template>