file-drop
file-drop copied to clipboard
Outdated readme about `filedrop` event's `file` property
It's files: File[] now
Respond to when a file is dropped on the element
When a user has succesfully dropped a file on to the element, the element will emit a
filedropevent. Thefiledropevent contains afileproperty which is a direct reference to theFilethat was dropped.<file-drop id="dropTarget">Drop a file here</file-drop> <script> dropTarget.addEventListener('filedrop', (e) => { dropTarget.textContent = e.file.name; }); </script>Note: if more than one file is dropped on the element, only the first file will be included on the event.