Finish space create form
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
export const copyToClipboard = (text: string) => {
|
||||
const {activeElement} = document
|
||||
const input = document.createElement("textarea")
|
||||
|
||||
input.innerHTML = text
|
||||
document.body.appendChild(input)
|
||||
input.select()
|
||||
|
||||
const result = document.execCommand("copy")
|
||||
|
||||
document.body.removeChild(input)
|
||||
;(activeElement as HTMLElement).focus()
|
||||
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user