]> source.dussan.org Git - jquery-ui.git/commitdiff
Autocomplete: Clear selectedItem property whenever the user types something. Also...
authorScott González <scott.gonzalez@gmail.com>
Tue, 20 Jul 2010 17:24:53 +0000 (13:24 -0400)
committerScott González <scott.gonzalez@gmail.com>
Tue, 20 Jul 2010 17:24:53 +0000 (13:24 -0400)
demos/autocomplete/combobox.html
ui/jquery.ui.autocomplete.js

index 4cc98d8f98892f7f88cc3a627793ae94fb044d1d..6c81b25ebf00358c6f325aba2bb135e5777aeec7 100644 (file)
@@ -43,6 +43,7 @@
                                                        if (!ui.item) {
                                                                // remove invalid value, as it didn't match anything
                                                                $(this).val("");
+                                                               select.val("");
                                                                return false;
                                                        }
                                                        select.val(ui.item.id);
index 7056e07f5587ca8618c0587699fd42feea0e2646..b9daad86bea96d77eff332e9a6daefc08be301b0 100644 (file)
@@ -79,6 +79,7 @@ $.widget( "ui.autocomplete", {
                                        self.searching = setTimeout(function() {
                                                // only search if the value has changed
                                                if ( self.term != self.element.val() ) {
+                                                       self.selectedItem = null;
                                                        self.search( null, event );
                                                }
                                        }, self.options.delay );