Skip to content

Commit 123467a

Browse files
committed
Autocomplete (combobox demo): Set intial value of text field based on value of select element. Partial fix for #5757 - Autocomplete combobox issues.
1 parent 5d1e297 commit 123467a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

demos/autocomplete/combobox.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@
2222
$.widget( "ui.combobox", {
2323
_create: function() {
2424
var self = this;
25-
var select = this.element.hide();
25+
var select = this.element.hide(),
26+
selected = select.children( ":selected" ),
27+
value = selected.val() ? selected.text() : "";
2628
var input = $( "<input>" )
2729
.insertAfter( select )
30+
.val( value )
2831
.autocomplete({
2932
delay: 0,
3033
minLength: 0,

0 commit comments

Comments
 (0)