Use innerText to copy code content

This commit is contained in:
sage 2021-08-07 15:38:32 +07:00
parent 47c8a819cf
commit 638c78f6ec
No known key found for this signature in database
GPG Key ID: 671C49FC9D6584E3

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)