do not add \x00 characters to document
This commit is contained in:
parent
4fe9cd5d95
commit
a3053c8353
1 changed files with 7 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue