Skip to content
Permalink
Browse files

Autocomplete: Clear selectedItem property whenever the user types som…

…ething. Also updated combobox to clear the select element when clearing the text element. Fixes #5453 - Autocomplete: combobox demo doesn't remove invalid values.
  • Loading branch information...
scottgonzalez committed Jul 20, 2010
1 parent e4273ff commit c2c09e89538ce071efba7ca1e923b5627c236f8c
Showing with 2 additions and 0 deletions.
  1. +1 −0 demos/autocomplete/combobox.html
  2. +1 −0 ui/jquery.ui.autocomplete.js
@@ -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);
@@ -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 );

0 comments on commit c2c09e8

Please sign in to comment.
You can’t perform that action at this time.