From 965dddd9818f7f24ec63666da356248a1c010636 Mon Sep 17 00:00:00 2001 From: jzaefferer Date: Wed, 23 Jun 2010 16:44:11 +0200 Subject: [PATCH] Autocomplete: Update cursor position in multiple demos in IE. Fixes #5761 - Autocomplete: multiple demos need extra IE handling for cursor position --- demos/autocomplete/multiple-remote.html | 7 +++++++ demos/autocomplete/multiple.html | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/demos/autocomplete/multiple-remote.html b/demos/autocomplete/multiple-remote.html index 5e0f4b50b7a..2046db61452 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 908cfe6ce7a..d8cb7e403af 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; } });