Use innerText to copy code content

This commit is contained in:
sage committed 2021-08-07 15:39:39 +07:00
1 parent 47c8a819cf
commit 638c78f6ec
1 file changed
+1 -1
+1 -1
View File
@@ -14,7 +14,7 @@ const Pre = (props) => {
}
const onCopy = () => {
setCopied(true)
navigator.clipboard.writeText(textInput.current.textContent)
navigator.clipboard.writeText(textInput.current.innerText)
setTimeout(() => {
setCopied(false)
}, 2000)