fix text input for iPad

This commit is contained in:
Fabian Jakobs 2011-02-01 15:58:49 +01:00
commit b0e6c5941c

View file

@ -59,10 +59,17 @@ var TextInput = function(parentNode, host) {
if (value) { if (value) {
if (value.charCodeAt(value.length-1) == PLACEHOLDER.charCodeAt(0)) { if (value.charCodeAt(value.length-1) == PLACEHOLDER.charCodeAt(0)) {
value = value.slice(0, -1); value = value.slice(0, -1);
if (value) if (value.length)
host.onTextInput(value); host.onTextInput(value);
} else }
if (value.charCodeAt(0) == PLACEHOLDER.charCodeAt(0)) {
value = value.slice(1, value.length);
if (value.length)
host.onTextInput(value);
}
else {
host.onTextInput(value); host.onTextInput(value);
}
} }
} }
copied = false; copied = false;