Merge pull request #167 from laymonage/use-innertext
Use `innerText` to copy code content
This commit is contained in:
commit
a73160947a
@ -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