diff --git a/assets/js/code.js b/assets/js/code.js index aae11907..541d0598 100644 --- a/assets/js/code.js +++ b/assets/js/code.js @@ -27,6 +27,7 @@ async function copyCodeToClipboard(button, highlightWrapper) { const sel = window.getSelection(); sel.removeAllRanges(); sel.addRange(range); + textArea.focus(); textArea.setSelectionRange(0, 999999); document.execCommand("copy"); highlightWrapper.removeChild(textArea);