From 9701c8aa6b6b0c7d8379ac3e25657f96bab61c3c Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Fri, 13 Dec 2024 13:56:59 +0100 Subject: [PATCH] fix: copy the right text --- resources/views/components/modal-confirmation.blade.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/views/components/modal-confirmation.blade.php b/resources/views/components/modal-confirmation.blade.php index 6f1dad8c9..4620d35ed 100644 --- a/resources/views/components/modal-confirmation.blade.php +++ b/resources/views/components/modal-confirmation.blade.php @@ -92,8 +92,9 @@ }); }, copyConfirmationText() { + const textToCopy = this.confirmationText; if (navigator.clipboard && window.isSecureContext) { - navigator.clipboard.writeText(this.confirmationText) + navigator.clipboard.writeText(textToCopy) .then(() => { this.copied = true; setTimeout(() => { @@ -102,7 +103,7 @@ }); } else { const textarea = document.createElement('textarea'); - textarea.value = this.confirmationText; + textarea.value = textToCopy; textarea.style.position = 'fixed'; textarea.style.opacity = '0'; document.body.appendChild(textarea);