RESOLVED DUPLICATE of bug 215837 170168
Implement the DataTransfer constructor
https://bugs.webkit.org/show_bug.cgi?id=170168
Summary Implement the DataTransfer constructor
Domenic Denicola
Reported 2017-03-27 22:52:30 PDT
Spec change: https://github.com/whatwg/html/commit/688a102b52c7050a6808a05c5d8fe149c0937fd7 Tests: http://w3c-test.org/html/editing/dnd/datastore/datatransfer-constructor-001.html This is part of a larger feature for async clipboard APIs; see discussion in https://github.com/w3c/clipboard-apis/issues/33. But it can be implemented independently.
Attachments
Jonathan
Comment 1 2019-12-30 01:13:39 PST
This constructor will also allow the instanciation of a FileList (it currently works on Firefox / Chromium) Without this API it's impossible to create a FileList from a File array const data = new DataTransfer() // This is not working on webkit files.forEach(file => data.items.add(file)) return data.files
Jimmy Wärting
Comment 2 2020-08-16 15:42:39 PDT
The only real usecase i see with having a DataTransfer constructor is having a way to update that damm input[type=file] with another FileList item. there is no way of getting it in safari... new ClipboardEvent('paste').clipboardData new DragEvent('drag').dataTransfer new DataTransfer() https://github.com/whatwg/html/issues/3269
Anne van Kesteren
Comment 4 2024-08-28 07:38:53 PDT
*** This bug has been marked as a duplicate of bug 215837 ***
Note You need to log in before you can comment on or make changes to this bug.