Stop click propagation on copy from code blocks Fixes #4214

380c88d401b6f4b262cab96883aedc37f0983b5d

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +3 -0Showing whitespace changes
public/script.js+3 -0
@@ -2561,6 +2561,9 @@ export function addCopyToCodeBlocks(messageElement) {
25612561 copyButton.classList.add('fa-solid', 'fa-copy', 'code-copy', 'interactable');
25622562 copyButton.title = 'Copy code';
25632563 codeBlocks.get(i).appendChild(copyButton);
2564+ copyButton.addEventListener('click', function (e) {
2565+ e.stopPropagation();
2566+ });
25642567 copyButton.addEventListener('pointerup', async function () {
25652568 const text = codeBlocks.get(i).innerText;
25662569 await copyText(text);