diff --git a/frontend/src/components/ui/copy-button.tsx b/frontend/src/components/ui/copy-button.tsx index 01ef862e..1ade7713 100644 --- a/frontend/src/components/ui/copy-button.tsx +++ b/frontend/src/components/ui/copy-button.tsx @@ -26,7 +26,21 @@ export function CopyButton({ setCopied(true) setTimeout(() => setCopied(false), 2000) } catch { - // Clipboard access denied or not supported + const textArea = document.createElement('textarea') + textArea.value = content + textArea.style.position = 'fixed' + textArea.style.left = '-9999px' + document.body.appendChild(textArea) + textArea.select() + try { + const successful = document.execCommand('copy') + if (successful) { + setCopied(true) + setTimeout(() => setCopied(false), 2000) + } + } finally { + document.body.removeChild(textArea) + } } }