document.execCommand("copy") always returns false

Fixed Issue #14080262

Details

Author
Lucas G.
Created
Oct 4, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
Found in build #
15.15063
Fixed in build #
17.17073
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

<script>
document.addEventListener("copy", function(e) {
e.clipboardData.setData("text/plain", “plain text”);
e.preventDefault();
});
function f() {
// The copy command succeeds, but this prints false.
console.log(document.execCommand(“copy”));
}
</script>
<button onclick="f()">Button</button>

Attachments

0 attachments

    Comments and activity

    • Note that all other browsers return true if the copy command succeeds: https://github.com/lgarron/clipboard.js/blob/v2/test/Conclusions.md#test-results

      (iOS Safari is marked as ⚠️ due to an interaction with another bug, but it returns true consistently with other browsers.)

    • Microsoft Edge Team

      Changed Assigned To to “James M.”

      Changed Assigned To to “travil”

      Changed Assigned To to “Grisha L.”

      Changed Assigned To from “Grisha L.” to “Amit J.”

      Changed Status to “Confirmed”

      Changed Status from “Confirmed” to “Fixed”

    You need to sign in to your Microsoft account to add a comment.

    Sign in