My list consists of simple elements created with the mat-card
component. I want to be able to highlight the mat-card
when dragging a file over it, and perform some action when the file is dropped. However, I'm facing two main issues:
- At times, when I drag too quickly, the status of the
mat-card
does not update correctly, resulting in multiple cards being highlighted. - The
e.preventDefault()
function on the drop event doesn't work as expected - the file ends up opening in the browser instead of triggering the desired behavior.
I've tried various solutions, including manually adding and removing event listeners, but nothing seems to resolve the problem. Hopefully, someone will be able to provide some assistance :)
For easier debugging, I have set up a demo using stackblitz
. You can access it here:
https://stackblitz.com/edit/angular-material-with-angular-v5-d2uted
Update:
Currently using Angular v5
and Angular Material 2