Autocomplete (combobox demo): Set intial value of text field based on value of select element. Partial fix for #5757 - Autocomplete combobox issues.

This commit is contained in:
Scott González 2010-07-20 14:49:14 -04:00
parent 5d1e297640
commit 123467af8e

View File

@ -22,9 +22,12 @@
$.widget( "ui.combobox", { $.widget( "ui.combobox", {
_create: function() { _create: function() {
var self = this; var self = this;
var select = this.element.hide(); var select = this.element.hide(),
selected = select.children( ":selected" ),
value = selected.val() ? selected.text() : "";
var input = $( "<input>" ) var input = $( "<input>" )
.insertAfter( select ) .insertAfter( select )
.val( value )
.autocomplete({ .autocomplete({
delay: 0, delay: 0,
minLength: 0, minLength: 0,