You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
accept attribute only works if you try to upload a file using the input HTML element, but if you try to drop an image/png the CSVReader doesn't throw an error, the validation can be made easily:
consttypeAccepted='text/csv, .csv, application/vnd.ms-excel';consthandleDrop=(e)=>{e.preventDefault();e.stopPropagation();const[file]=e.dataTransfer.files;if(file.type&&typeAccepted.includes(file.type)){// do something}else{console.error(`File type ${file.type} is not accepted`);returnfalse;}}
I would love to be able to submit a PR but I have no idea about TS
The text was updated successfully, but these errors were encountered:
accept
attribute only works if you try to upload a file using the input HTML element, but if you try to drop animage/png
theCSVReader
doesn't throw an error, the validation can be made easily:I would love to be able to submit a PR but I have no idea about TS
The text was updated successfully, but these errors were encountered: