From 123467af8efc8541e333979a59ca9db36fec9cda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 20 Jul 2010 14:49:14 -0400 Subject: [PATCH] Autocomplete (combobox demo): Set intial value of text field based on value of select element. Partial fix for #5757 - Autocomplete combobox issues. --- demos/autocomplete/combobox.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/demos/autocomplete/combobox.html b/demos/autocomplete/combobox.html index c76cfa130..1b7b668a9 100644 --- a/demos/autocomplete/combobox.html +++ b/demos/autocomplete/combobox.html @@ -22,9 +22,12 @@ $.widget( "ui.combobox", { _create: function() { var self = this; - var select = this.element.hide(); + var select = this.element.hide(), + selected = select.children( ":selected" ), + value = selected.val() ? selected.text() : ""; var input = $( "" ) .insertAfter( select ) + .val( value ) .autocomplete({ delay: 0, minLength: 0,