From 4a19f9c52e72a6333cdbaec83a2c7e81ac25ff3d Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Wed, 27 Oct 2021 16:12:42 +0200 Subject: [PATCH] Copy to clipboard method update --- cara/apps/calculator/static/js/report.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/cara/apps/calculator/static/js/report.js b/cara/apps/calculator/static/js/report.js index e04fc9e8..29f9b907 100644 --- a/cara/apps/calculator/static/js/report.js +++ b/cara/apps/calculator/static/js/report.js @@ -536,11 +536,6 @@ function copy_clipboard(shareable_link) { $("#mobile_link").attr('title', 'Copied!') .tooltip('_fixTitle') .tooltip('show'); - - const el = document.createElement('textarea'); - el.value = shareable_link; - document.body.appendChild(el); - el.select(); - document.execCommand('copy'); - document.body.removeChild(el); + + navigator.clipboard.writeText(shareable_link); } \ No newline at end of file