Skip to content

Commit 965dddd

Browse files
committed
Autocomplete: Update cursor position in multiple demos in IE. Fixes #5761 - Autocomplete: multiple demos need extra IE handling for cursor position
1 parent 496b408 commit 965dddd

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

demos/autocomplete/multiple-remote.html

+7
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@
4545
// add placeholder to get the comma-and-space at the end
4646
terms.push("");
4747
this.value = terms.join(", ");
48+
if ( document.selection ) {
49+
this.focus();
50+
var range = document.selection.createRange();
51+
range.moveStart( 'character', this.value.length );
52+
range.moveEnd( 'character', 0 );
53+
range.select();
54+
}
4855
return false;
4956
}
5057
});

demos/autocomplete/multiple.html

+7
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@
3939
// add placeholder to get the comma-and-space at the end
4040
terms.push("");
4141
this.value = terms.join(", ");
42+
if ( document.selection ) {
43+
this.focus();
44+
var range = document.selection.createRange();
45+
range.moveStart( 'character', this.value.length );
46+
range.moveEnd( 'character', 0 );
47+
range.select();
48+
}
4249
return false;
4350
}
4451
});

0 commit comments

Comments
 (0)