From: jzaefferer Date: Wed, 23 Jun 2010 14:44:11 +0000 (+0200) Subject: Autocomplete: Update cursor position in multiple demos in IE. Fixes #5761 - Autocompl... X-Git-Tag: 1.8.3~68 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=965dddd9818f7f24ec63666da356248a1c010636;p=jquery-ui.git Autocomplete: Update cursor position in multiple demos in IE. Fixes #5761 - Autocomplete: multiple demos need extra IE handling for cursor position --- diff --git a/demos/autocomplete/multiple-remote.html b/demos/autocomplete/multiple-remote.html index 5e0f4b50b..2046db614 100644 --- a/demos/autocomplete/multiple-remote.html +++ b/demos/autocomplete/multiple-remote.html @@ -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; } }); diff --git a/demos/autocomplete/multiple.html b/demos/autocomplete/multiple.html index 908cfe6ce..d8cb7e403 100644 --- a/demos/autocomplete/multiple.html +++ b/demos/autocomplete/multiple.html @@ -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; } });