fix: copy the right text
This commit is contained in:
@@ -92,8 +92,9 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
copyConfirmationText() {
|
copyConfirmationText() {
|
||||||
|
const textToCopy = this.confirmationText;
|
||||||
if (navigator.clipboard && window.isSecureContext) {
|
if (navigator.clipboard && window.isSecureContext) {
|
||||||
navigator.clipboard.writeText(this.confirmationText)
|
navigator.clipboard.writeText(textToCopy)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.copied = true;
|
this.copied = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -102,7 +103,7 @@
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
const textarea = document.createElement('textarea');
|
const textarea = document.createElement('textarea');
|
||||||
textarea.value = this.confirmationText;
|
textarea.value = textToCopy;
|
||||||
textarea.style.position = 'fixed';
|
textarea.style.position = 'fixed';
|
||||||
textarea.style.opacity = '0';
|
textarea.style.opacity = '0';
|
||||||
document.body.appendChild(textarea);
|
document.body.appendChild(textarea);
|
||||||
|
Reference in New Issue
Block a user