We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1369bce commit 4d675a2Copy full SHA for 4d675a2
send.ts
@@ -36,11 +36,14 @@
36
if (!document.activeElement) {
37
throw new Error("`document.activeElement` is null");
38
}
39
- document.activeElement.appendChild(pasteTarget);
+ const activeElement = document.activeElement.appendChild(pasteTarget).parentNode;
40
pasteTarget.focus();
41
document.execCommand("Paste");
42
const paste = pasteTarget.innerText;
43
- document.activeElement.removeChild(pasteTarget);
+ if (!activeElement) {
44
+ throw new Error("`activeElement` is null")
45
+ }
46
+ activeElement.removeChild(pasteTarget);
47
return paste;
48
};
49
0 commit comments