go-js-dom icon indicating copy to clipboard operation
go-js-dom copied to clipboard

Missing document.execCommand()?

Open kylewolfe opened this issue 8 years ago • 4 comments

How would the equivalent of document.execCommand() be achieved in this library?

kylewolfe avatar May 22 '17 14:05 kylewolfe

/cc @shurcooL

dominikh avatar May 22 '17 16:05 dominikh

From looking at the API of this library, it appears it does not currently have support for execCommand.

If your question is "how would the equivalent of document.execCommand() be achieved in general", I don't know, that requires investigation. It's not a priority for me at this time, so I'm not working on it.

If you're interested in working on this, feel free to look into it.

dmitshur avatar May 22 '17 18:05 dmitshur

I am using this as work-around:

js.Global.Get("document").Call("execCommand", "copy") // document.execCommand('copy');

udhos avatar Jun 30 '17 14:06 udhos

Thanks @udhos, that sounds like the right solution. We can add an ExecCommand method that uses such an implementation. Whoever is interested in getting this added to dom can send a PR.

dmitshur avatar Jun 30 '17 15:06 dmitshur