Use innerText to copy code content

This commit is contained in:
sage
2021-08-07 15:38:32 +07:00
parent 47c8a819cf
commit 638c78f6ec

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)