fix copy fallback for safari

Signed-off-by: NSStudent <omarmn83@gmail.com>
This commit is contained in:
NSStudent
2025-12-08 21:12:14 +01:00
parent 7ce8be1d2f
commit 8ba07f0d59

View File

@@ -32,6 +32,7 @@ async function copyCodeToClipboard(button, highlightDiv) {
const sel = window.getSelection();
sel.removeAllRanges();
sel.addRange(range);
textArea.focus();
textArea.setSelectionRange(0, 999999);
document.execCommand("copy");
highlightDiv.removeChild(textArea);