Use innerText to copy code content
This commit is contained in:
parent
47c8a819cf
commit
638c78f6ec
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user