feat(nui): copy query on left click

This commit is contained in:
Luke committed 2022-03-02 16:11:17 +01:00
1 parent 98b4f108e8
commit 82006d251d
2 files changed
+55 -18

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
// yoinked from https://github.com/project-error/npwd/blob/d8dc5b7f47faf5fc581ffee30f31ff61d184cfe7/phone/src/os/phone/hooks/useClipboard.ts#L1
export const setClipboard = (value: string) => {
const clipElem = document.createElement('input');
clipElem.value = value;
document.body.appendChild(clipElem);
clipElem.select();
document.execCommand('copy');
document.body.removeChild(clipElem);
};