We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef4fcf7 commit 7784538Copy full SHA for 7784538
frontend/app/services/clipboard-service.js
@@ -2,16 +2,6 @@ import Service from "@ember/service";
2
3
export default class ClipboardService extends Service {
4
copy(text) {
5
- // Copying to clipboard is not possible in another way. Even libraries do it with a fake element.
6
- // We don't use the addon ember-cli-clipboard, as we need to wait for a async call to finish.
7
- const fakeEl = document.createElement("textarea");
8
- fakeEl.value = text;
9
- fakeEl.setAttribute("readonly", "");
10
- fakeEl.style.position = "absolute";
11
- fakeEl.style.left = "-9999px";
12
- document.body.appendChild(fakeEl);
13
- fakeEl.select();
14
- document.execCommand("copy");
15
- document.body.removeChild(fakeEl);
+ navigator.clipboard.writeText(text);
16
}
17
0 commit comments