]> source.dussan.org Git - jquery-ui.git/commitdiff
Autocomplete: Update cursor position in multiple demos in IE. Fixes #5761 - Autocompl...
authorjzaefferer <joern.zaefferer@gmail.com>
Wed, 23 Jun 2010 14:44:11 +0000 (16:44 +0200)
committerjzaefferer <joern.zaefferer@gmail.com>
Wed, 23 Jun 2010 14:44:11 +0000 (16:44 +0200)
demos/autocomplete/multiple-remote.html
demos/autocomplete/multiple.html

index 5e0f4b50b7ad3169d18280c1436c1a2d162dca20..2046db6145206bb2a1fd29746f2731d8868519fc 100644 (file)
                                // 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;
                        }
                });
index 908cfe6ce7a494edb64efdace4edf034f9bb4c5b..d8cb7e403af5a4630211196e32566b62740a9efe 100644 (file)
                                // 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;
                        }
                });