From c02453860408509b714c5e853457b66ef07712fc Mon Sep 17 00:00:00 2001 From: Alexander Danilov Date: Mon, 4 Jul 2022 09:55:54 +0300 Subject: [PATCH] Ignore code block clicks with active selection (#448) --- assets/clipboard.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/assets/clipboard.js b/assets/clipboard.js index fdf84cf..2799f2f 100644 --- a/assets/clipboard.js +++ b/assets/clipboard.js @@ -11,6 +11,9 @@ document.querySelectorAll("pre code").forEach(code => { code.addEventListener("click", function (event) { + if (window.getSelection().toString()) { + return; + } select(code.parentElement); if (navigator.clipboard) {