Autocomplete: Always reset this.term after a select event, even if the select is cancelled. Fixes #6221 - Autocomplete: Doesn't reset after Select when textbox cleared, if same letters typed in rapidly; source function not triggered in that case.

This commit is contained in:
Scott González 2010-10-25 10:01:43 -04:00
parent a0847f3a08
commit 5c67ed26e8

View File

@ -181,9 +181,11 @@ $.widget( "ui.autocomplete", {
}
if ( false !== self._trigger( "select", event, { item: item } ) ) {
self.term = item.value;
self.element.val( item.value );
}
// reset the term after the select event
// this allows custom select handling to work properly
self.term = self.element.val();
self.close( event );
self.selectedItem = item;