- From: Wenson Hsieh <notifications@github.com>
- Date: Thu, 10 Oct 2019 13:44:34 -0700
- To: w3c/clipboard-apis <clipboard-apis@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 10 October 2019 20:44:36 UTC
Currently, the first argument in ClipboardItem’s constructor takes a record of `DOMString` to `ClipboardItemData`, which is a `Promise<ClipboardItemDataType>` where `ClipboardItemDataType` is either a string or a blob. However, the following code: ``` const item = new ClipboardItem({ "text/plain" : new Blob(["foo"], { type: "text/plain" }) }); ``` works fine in Chrome 77.0.3865.120, whereas: ``` const item = new ClipboardItem({ "text/plain" : new Promise(r => r(new Blob(["foo"], { type: "text/plain" }))) }); ``` results in `TypeError: Failed to construct 'ClipboardItem': Failed to convert value to 'Blob’.`. Should the spec be revised to allow for either `ClipboardItemData` or `ClipboardItemDataType` as record values? For reference: https://www.w3.org/TR/clipboard-apis/#clipboarditem -- 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/102
Received on Thursday, 10 October 2019 20:44:36 UTC