do not add \x00 characters to document

This commit is contained in:
nightwing 2012-04-21 12:25:41 +04:00
commit a3053c8353

View file

@ -72,16 +72,14 @@ var TextInput = function(parentNode, host, listenElement) {
if (!copied) {
var value = valueToSend || text.value;
if (value) {
if (value.charCodeAt(value.length-1) == PLACEHOLDER.charCodeAt(0)) {
value = value.slice(0, -1);
if (value) {
if (pasted)
host.onPaste(value);
else
host.onTextInput(value);
}
if (value.length > 1) {
if (value.charAt(0) == PLACEHOLDER)
value = value.substr(1);
else if (value.charAt(value.length - 1) == PLACEHOLDER)
value = value.slice(0, -1);
}
else {
if (value && value != PLACEHOLDER) {
if (pasted)
host.onPaste(value);
else