diff --git a/libs/remix-ui/remix-ai/src/lib/components/Default.tsx b/libs/remix-ui/remix-ai/src/lib/components/Default.tsx index 080400ddfdf..ae1a376d938 100644 --- a/libs/remix-ui/remix-ai/src/lib/components/Default.tsx +++ b/libs/remix-ui/remix-ai/src/lib/components/Default.tsx @@ -36,6 +36,9 @@ export const Default = (props) => { Array.from(codeBlocks).forEach((block) => { const copyButtons = block.getElementsByClassName('nlux-comp-copyButton'); Array.from(copyButtons).forEach((cp_btn) => { + // remove click event listener if existing + cp_btn.removeEventListener('click', () => {}); + cp_btn.addEventListener('click', async () => { await navigator.clipboard.writeText(block.textContent); });