Restore previous focus after setting HTML5 clipboard

This commit is contained in:
Joshua Granick
2020-03-16 21:23:32 -07:00
parent a2413c4fad
commit 8ca1927844

View File

@@ -915,6 +915,9 @@ class HTML5Window
textArea.style.width = "0px";
Browser.document.body.appendChild(textArea);
}
var cacheElement = Browser.document.activeElement;
textArea.value = value;
textArea.focus();
textArea.select();
@@ -923,6 +926,11 @@ class HTML5Window
{
Browser.document.execCommand("copy");
}
if (cacheElement != null && cacheElement != textArea)
{
cacheElement.focus();
}
}
public function setCursor(value:MouseCursor):MouseCursor