fix: maybe fallback is now working

This commit is contained in:
peaklabs-dev
2024-12-13 14:05:31 +01:00
parent 9701c8aa6b
commit b25463b084

View File

@@ -92,9 +92,8 @@
}); });
}, },
copyConfirmationText() { copyConfirmationText() {
const textToCopy = this.confirmationText;
if (navigator.clipboard && window.isSecureContext) { if (navigator.clipboard && window.isSecureContext) {
navigator.clipboard.writeText(textToCopy) navigator.clipboard.writeText(this.confirmationText)
.then(() => { .then(() => {
this.copied = true; this.copied = true;
setTimeout(() => { setTimeout(() => {
@@ -103,9 +102,10 @@
}); });
} else { } else {
const textarea = document.createElement('textarea'); const textarea = document.createElement('textarea');
textarea.value = textToCopy; textarea.value = this.confirmationText;
textarea.style.position = 'fixed'; textarea.style.position = 'absolute';
textarea.style.opacity = '0'; textarea.style.left = '-9999px';
textarea.style.top = '0';
document.body.appendChild(textarea); document.body.appendChild(textarea);
textarea.select(); textarea.select();
try { try {