Reorder the logic for the copy / past in HTML5
Added a focus() fix for copy/paste operations in Chrome.
This commit is contained in:
committed by
Joshua Granick
parent
70493d21c2
commit
db8279e928
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user