new fallback approach
This commit is contained in:
@@ -101,24 +101,18 @@
|
|||||||
}, 2000);
|
}, 2000);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
const textarea = document.createElement('textarea');
|
const input = document.createElement('input');
|
||||||
textarea.value = this.confirmationText;
|
input.setAttribute('readonly', '');
|
||||||
textarea.style.position = 'absolute';
|
input.setAttribute('value', this.confirmationText);
|
||||||
textarea.style.left = '-9999px';
|
document.body.appendChild(input);
|
||||||
textarea.style.top = '0';
|
input.select();
|
||||||
document.body.appendChild(textarea);
|
input.setSelectionRange(0, 99999);
|
||||||
textarea.select();
|
document.execCommand('copy');
|
||||||
try {
|
document.body.removeChild(input);
|
||||||
document.execCommand('copy');
|
this.copied = true;
|
||||||
this.copied = true;
|
setTimeout(() => {
|
||||||
setTimeout(() => {
|
this.copied = false;
|
||||||
this.copied = false;
|
}, 2000);
|
||||||
}, 2000);
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Failed to copy text:', err);
|
|
||||||
} finally {
|
|
||||||
document.body.removeChild(textarea);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toggleAction(id) {
|
toggleAction(id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user