Reorder the logic for the copy / past in HTML5

Added a focus() fix for copy/paste operations in Chrome.
This commit is contained in:
Andrew Sevenson
2019-12-03 11:28:05 +11:00
committed by Joshua Granick
parent 70493d21c2
commit db8279e928

View File

@@ -903,8 +903,6 @@ class HTML5Window
}
public function setClipboard(value:String):Void
{
if (Browser.document.queryCommandEnabled("copy"))
{
if (textArea == null)
{
@@ -917,10 +915,12 @@ class HTML5Window
textArea.style.width = "0px";
Browser.document.body.appendChild(textArea);
}
textArea.value = value;
textArea.focus();
textArea.select();
if (Browser.document.queryCommandEnabled("copy"))
{
Browser.document.execCommand("copy");
}
}