I am trying to check the type/extension of a file on dragover (before drop) and cannot seem to do this. For some reason the files array has a length of zero on dragover. I have tried using a dragenter event as well with the same result. A lot of people on similar posts say how it is now possible to check the file type after some browser updates but I cannot seem to figure out how.
function checkFile(event: dragEvent){
event.stopPropagation();
event.preventDefault();
const files = event.dataTransfer?.files;
console.log(files)
}
This function is called from a drop area.
<div ..... @dragover = 'checkFile'>