fix copy and paste issue in Chrome and Safari

This commit is contained in:
Fabian Jakobs 2010-10-20 11:24:54 +02:00
commit b6da535e20

View file

@ -71,6 +71,7 @@ var TextInput = function(parentNode, host) {
text.value = host.getCopyText(); text.value = host.getCopyText();
text.select(); text.select();
copied = true; copied = true;
setTimeout(sendText, 0);
}; };
var onCut = function() { var onCut = function() {
@ -78,6 +79,7 @@ var TextInput = function(parentNode, host) {
text.value = host.getCopyText(); text.value = host.getCopyText();
host.onCut(); host.onCut();
text.select(); text.select();
setTimeout(sendText, 0);
}; };
event.addListener(text, "keypress", onTextInput); event.addListener(text, "keypress", onTextInput);