Autocomplete: Update cursor position in multiple demos in IE. Fixes #5761 - Autocomplete: multiple demos need extra IE handling for cursor position

This commit is contained in:
jzaefferer 2010-06-23 16:44:11 +02:00
parent 496b40802b
commit 965dddd981
2 changed files with 14 additions and 0 deletions

View File

@ -45,6 +45,13 @@
// add placeholder to get the comma-and-space at the end
terms.push("");
this.value = terms.join(", ");
if ( document.selection ) {
this.focus();
var range = document.selection.createRange();
range.moveStart( 'character', this.value.length );
range.moveEnd( 'character', 0 );
range.select();
}
return false;
}
});

View File

@ -39,6 +39,13 @@
// add placeholder to get the comma-and-space at the end
terms.push("");
this.value = terms.join(", ");
if ( document.selection ) {
this.focus();
var range = document.selection.createRange();
range.moveStart( 'character', this.value.length );
range.moveEnd( 'character', 0 );
range.select();
}
return false;
}
});