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

There is no copying. DragEvents have 
readonly attribute DataTransfer? dataTransfer;
and ClipboardEvents have 
readonly attribute DataTransfer? clipboardData;

One can reuse the same DataTransfer object in ClipboardEvents.

something like
`
element.ondrop = function(e) {
  element.dispatchEvent(new ClipboardEvent("paste", {clipboardData: e.dataTransfer}));
}

element.onpaste = function(e) {
  // handle paste and drop...
}
`

Or are we talking about different things here?

-- 
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-268050555

Received on Monday, 19 December 2016 19:11:15 UTC