Closed AloyBranCheung closed 2 years ago
Will do. In terms of the highlighting, would you like to replace that with something else for better user feedback/UX when clicking the copy button?
Ok, I removed the formatting and highlighting.
Similar to what GitHub does at the top of this page when you click the little copy icon next to the branch name.
Closes #85
To maintain text highlighting when the button is clicked I kept the origin code.
To switch to clipboard API, I just replaced
document.execCommand("copy")
withnavigator.clipboard.writeText(element.innerText);