fix: avoid extra new line when copying

This commit is contained in:
Timothy Lin
2021-09-08 22:09:31 +08:00
parent aed6d7782d
commit 55e8c442d1
3 changed files with 5 additions and 5 deletions

View File

@ -14,7 +14,7 @@ const Pre = (props) => {
}
const onCopy = () => {
setCopied(true)
navigator.clipboard.writeText(textInput.current.innerText)
navigator.clipboard.writeText(textInput.current.textContent)
setTimeout(() => {
setCopied(false)
}, 2000)