mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-09-01 02:18:02 +00:00
Fix copy to clipboard for iOS 10/11
This commit is contained in:
@@ -240,6 +240,7 @@ exports.copyToClipboard = function(text,options) {
|
|||||||
textArea.style.position = "fixed";
|
textArea.style.position = "fixed";
|
||||||
textArea.style.top = 0;
|
textArea.style.top = 0;
|
||||||
textArea.style.left = 0;
|
textArea.style.left = 0;
|
||||||
|
textArea.style.fontSize = "12pt";
|
||||||
textArea.style.width = "2em";
|
textArea.style.width = "2em";
|
||||||
textArea.style.height = "2em";
|
textArea.style.height = "2em";
|
||||||
textArea.style.padding = 0;
|
textArea.style.padding = 0;
|
||||||
@@ -250,6 +251,7 @@ exports.copyToClipboard = function(text,options) {
|
|||||||
textArea.value = text;
|
textArea.value = text;
|
||||||
document.body.appendChild(textArea);
|
document.body.appendChild(textArea);
|
||||||
textArea.select();
|
textArea.select();
|
||||||
|
textArea.setSelectionRange(0,text.length);
|
||||||
var succeeded = false;
|
var succeeded = false;
|
||||||
try {
|
try {
|
||||||
succeeded = document.execCommand("copy");
|
succeeded = document.execCommand("copy");
|
||||||
|
Reference in New Issue
Block a user