Re: [w3c/clipboard-apis] Where would one get a DataTransfer to hand to the ClipboardEvent constructor? (#33)

@domenic fwiw followed the links and share the below as not certain with whom else to share the results, if not applicable here will delete when advised the same.

```
    class _DataTransfer {
      constructor() {
        return new ClipboardEvent("").clipboardData || new DataTransfer();
      }
    }
```

initially appeared to be a promising solution for Chromium 62 and Firefox 57 following previous attempts for same code solution at both browsers https://gist.github.com/guest271314/7eac2c21911f5e40f48933ac78e518bd, though `.files` property of created `DataTransfer` object is not retained after setting `.files` property of `<input type="file">` element to that `FileList` object http://plnkr.co/edit/1TSHMOWoyGEWRYKIEf7S?p=preview see version 1, to reproduce click `<label>` element twice. 

Is the expected result for `DataTransfer` instance `.files` property to not persist? Or are values set using   expected to be deleted from the object at some point? Does the specification state that `.files` property of a created `DataTransfer` object, and, or `File` objects set using `DataTransferItems` `.add()` metod should be deleted at an arbitrary point in the future, for example, when the `.files` property is set an `<input type="file">` element?

It was necessary to create a new instance of `DataTransfer` at each `click` of `<label>` to achieve same result at Chromium 62 and Firefox 57, see version 2. Is this the expected behaviour according to the specification?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/clipboard-apis/issues/33#issuecomment-343756443

Received on Sunday, 12 November 2017 18:23:28 UTC