dominikh / go-js-dom

MIT License
249 stars 42 forks source link

Missing document.execCommand()? #37

Open kylewolfe opened 7 years ago

kylewolfe commented 7 years ago

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

dominikh commented 7 years ago

/cc @shurcooL

dmitshur commented 7 years ago

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.

udhos commented 7 years ago

I am using this as work-around:

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

dmitshur commented 7 years ago

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.