Closed blink1073 closed 7 years ago
The error is because the ClipboardEvent
is not officially a part of Javascript/Typescript. It's somewhat of a temporary fix, since every browser handles the clipboard slightly differently. Chrome and Firefox both support the ClipboardEvent
. It's probably best to either leave it as is, or change it to any
for now, since handling the clipboard on Internet Explorer looks to be difficult.
If there is a better way to handle the web clipboard, I'd be glad to hear of it, though.
According to Mozilla it is supported as of IE 5.0: https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent/clipboardData
But perhaps not the getData
and setData
methods...
The events are not supported, though: https://developer.mozilla.org/en-US/docs/Web/Events/copy
That's why things like Google Docs fake copy + paste (works within the same domain, etc.) and others use ZeroClipboard (which is a flash library) for access to the system copy + paste buffers (see sharecell's use of ZeroClipboard).
The demo looks great! I had to change these to
any
to get it to compile. These were the only two lines in the repo that contained the wordClipboardEvent
.